revert: "refactor: update deprecated and minor code refactors (#710)"

This reverts commit 6829d3cdea.

Signed-off-by: EvadeMaster <93124920+EvadeMaster@users.noreply.github.com>
This commit is contained in:
EvadeMaster 2023-03-03 18:06:24 +07:00
parent 6d60541626
commit 68ccefc59f
No known key found for this signature in database
GPG key ID: 90BAB50981420F89
15 changed files with 94 additions and 95 deletions

View file

@ -1,5 +1,4 @@
import 'dart:io';
import 'package:cr_file_saver/file_saver.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:file_picker/file_picker.dart';
@ -75,18 +74,14 @@ class SettingsViewModel extends BaseViewModel {
if (outFile.existsSync()) {
final String dateTime =
DateTime.now().toString().replaceAll(' ', '_').split('.').first;
await CRFileSaver.saveFileWithDialog(
SaveFileDialogParams(
sourceFilePath: outFile.path,
destinationFileName: 'selected_patches_$dateTime.json',
),
);
await CRFileSaver.saveFileWithDialog(SaveFileDialogParams(
sourceFilePath: outFile.path, destinationFileName: 'selected_patches_$dateTime.json',),);
_toast.showBottom('settingsView.exportedPatches');
} else {
_toast.showBottom('settingsView.noExportFileFound');
}
} on Exception catch (e, s) {
Sentry.captureException(e, stackTrace: s).ignore();
Sentry.captureException(e, stackTrace: s);
}
}
@ -106,7 +101,7 @@ class SettingsViewModel extends BaseViewModel {
_toast.showBottom('settingsView.importedPatches');
}
} on Exception catch (e, s) {
Sentry.captureException(e, stackTrace: s).ignore();
await Sentry.captureException(e, stackTrace: s);
_toast.showBottom('settingsView.jsonSelectorErrorMessage');
}
}