Skip to content

Commit

Permalink
fix: Don't show toasts when export cancelled (#2230)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAabedKhan authored Oct 17, 2024
1 parent 820cd72 commit bd79496
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/ui/views/settings/settings_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,15 @@ class SettingsViewModel extends BaseViewModel {
if (outFile.existsSync()) {
final String dateTime =
DateTime.now().toString().replaceAll(' ', '_').split('.').first;
await FlutterFileDialog.saveFile(
final status = await FlutterFileDialog.saveFile(
params: SaveFileDialogParams(
sourceFilePath: outFile.path,
fileName: 'selected_patches_$dateTime.json',
),
);
_toast.showBottom(t.settingsView.exportedPatches);
if (status != null) {
_toast.showBottom(t.settingsView.exportedPatches);
}
} else {
_toast.showBottom(t.settingsView.noExportFileFound);
}
Expand Down Expand Up @@ -279,13 +281,15 @@ class SettingsViewModel extends BaseViewModel {
if (outFile.existsSync()) {
final String dateTime =
DateTime.now().toString().replaceAll(' ', '_').split('.').first;
await FlutterFileDialog.saveFile(
final status = await FlutterFileDialog.saveFile(
params: SaveFileDialogParams(
sourceFilePath: outFile.path,
fileName: 'keystore_$dateTime.keystore',
),
);
_toast.showBottom(t.settingsView.exportedKeystore);
if (status != null) {
_toast.showBottom(t.settingsView.exportedKeystore);
}
} else {
_toast.showBottom(t.settingsView.noKeystoreExportFileFound);
}
Expand Down

0 comments on commit bd79496

Please sign in to comment.