mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-12 04:37:37 +02:00
refactor: improve code readability according to formatter
This commit is contained in:
@ -17,8 +17,7 @@ import 'package:stacked/stacked.dart';
|
||||
import 'package:stacked_services/stacked_services.dart';
|
||||
|
||||
class SettingsViewModel extends BaseViewModel {
|
||||
final NavigationService _navigationService =
|
||||
locator<NavigationService>();
|
||||
final NavigationService _navigationService = locator<NavigationService>();
|
||||
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
||||
final Toast _toast = locator<Toast>();
|
||||
|
||||
@ -63,11 +62,8 @@ class SettingsViewModel extends BaseViewModel {
|
||||
try {
|
||||
final File outFile = File(_managerAPI.storedPatchesFile);
|
||||
if (outFile.existsSync()) {
|
||||
final String dateTime = DateTime.now()
|
||||
.toString()
|
||||
.replaceAll(' ', '_')
|
||||
.split('.')
|
||||
.first;
|
||||
final String dateTime =
|
||||
DateTime.now().toString().replaceAll(' ', '_').split('.').first;
|
||||
await CRFileSaver.saveFileWithDialog(
|
||||
SaveFileDialogParams(
|
||||
sourceFilePath: outFile.path,
|
||||
@ -87,8 +83,7 @@ class SettingsViewModel extends BaseViewModel {
|
||||
|
||||
Future<void> importPatches() async {
|
||||
try {
|
||||
final FilePickerResult? result =
|
||||
await FilePicker.platform.pickFiles(
|
||||
final FilePickerResult? result = await FilePicker.platform.pickFiles(
|
||||
type: FileType.custom,
|
||||
allowedExtensions: ['json'],
|
||||
);
|
||||
@ -109,7 +104,7 @@ class SettingsViewModel extends BaseViewModel {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> exportKeystore() async {
|
||||
Future<void> exportKeystore() async {
|
||||
try {
|
||||
final File outFile = File(_managerAPI.keystoreFile);
|
||||
if (outFile.existsSync()) {
|
||||
@ -138,7 +133,7 @@ class SettingsViewModel extends BaseViewModel {
|
||||
if (result != null && result.files.single.path != null) {
|
||||
final File inFile = File(result.files.single.path!);
|
||||
inFile.copySync(_managerAPI.keystoreFile);
|
||||
|
||||
|
||||
_toast.showBottom('settingsView.importedKeystore');
|
||||
}
|
||||
} on Exception catch (e) {
|
||||
|
Reference in New Issue
Block a user