chore: update cr_file_saver (#668)

Co-authored-by: Ushie <github@ushie.dev>
This commit is contained in:
Mipirakas
2023-01-30 13:11:31 +01:00
committed by GitHub
parent 40888c07f3
commit 8591bc4d01
3 changed files with 3 additions and 15 deletions

View File

@ -74,12 +74,8 @@ class SettingsViewModel extends BaseViewModel {
if (outFile.existsSync()) {
String dateTime =
DateTime.now().toString().replaceAll(' ', '_').split('.').first;
String tempFilePath =
'${outFile.path.substring(0, outFile.path.lastIndexOf('/') + 1)}selected_patches_$dateTime.json';
outFile.copySync(tempFilePath);
await CRFileSaver.saveFileWithDialog(SaveFileDialogParams(
sourceFilePath: tempFilePath, destinationFileName: ''));
File(tempFilePath).delete();
sourceFilePath: outFile.path, destinationFileName: 'selected_patches_$dateTime.json'));
_toast.showBottom('settingsView.exportedPatches');
} else {
_toast.showBottom('settingsView.noExportFileFound');