mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2026-01-11 13:46:17 +00:00
fix: Don't show toasts when export cancelled (#2230)
This commit is contained in:
@@ -228,13 +228,15 @@ class SettingsViewModel extends BaseViewModel {
|
|||||||
if (outFile.existsSync()) {
|
if (outFile.existsSync()) {
|
||||||
final String dateTime =
|
final String dateTime =
|
||||||
DateTime.now().toString().replaceAll(' ', '_').split('.').first;
|
DateTime.now().toString().replaceAll(' ', '_').split('.').first;
|
||||||
await FlutterFileDialog.saveFile(
|
final status = await FlutterFileDialog.saveFile(
|
||||||
params: SaveFileDialogParams(
|
params: SaveFileDialogParams(
|
||||||
sourceFilePath: outFile.path,
|
sourceFilePath: outFile.path,
|
||||||
fileName: 'selected_patches_$dateTime.json',
|
fileName: 'selected_patches_$dateTime.json',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
if (status != null) {
|
||||||
_toast.showBottom(t.settingsView.exportedPatches);
|
_toast.showBottom(t.settingsView.exportedPatches);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
_toast.showBottom(t.settingsView.noExportFileFound);
|
_toast.showBottom(t.settingsView.noExportFileFound);
|
||||||
}
|
}
|
||||||
@@ -279,13 +281,15 @@ class SettingsViewModel extends BaseViewModel {
|
|||||||
if (outFile.existsSync()) {
|
if (outFile.existsSync()) {
|
||||||
final String dateTime =
|
final String dateTime =
|
||||||
DateTime.now().toString().replaceAll(' ', '_').split('.').first;
|
DateTime.now().toString().replaceAll(' ', '_').split('.').first;
|
||||||
await FlutterFileDialog.saveFile(
|
final status = await FlutterFileDialog.saveFile(
|
||||||
params: SaveFileDialogParams(
|
params: SaveFileDialogParams(
|
||||||
sourceFilePath: outFile.path,
|
sourceFilePath: outFile.path,
|
||||||
fileName: 'keystore_$dateTime.keystore',
|
fileName: 'keystore_$dateTime.keystore',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
if (status != null) {
|
||||||
_toast.showBottom(t.settingsView.exportedKeystore);
|
_toast.showBottom(t.settingsView.exportedKeystore);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
_toast.showBottom(t.settingsView.noKeystoreExportFileFound);
|
_toast.showBottom(t.settingsView.noKeystoreExportFileFound);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user