diff --git a/lib/services/patcher_api.dart b/lib/services/patcher_api.dart index 65b1cad2..90070cd3 100644 --- a/lib/services/patcher_api.dart +++ b/lib/services/patcher_api.dart @@ -259,16 +259,8 @@ class PatcherAPI { try { if (_outFile != null) { String newName = _getFileName(appName, version); - - // This is temporary workaround to populate initial file name - // ref: https://github.com/Cleveroad/cr_file_saver/issues/7 - int lastSeparator = _outFile!.path.lastIndexOf('/'); - String newSourcePath = - _outFile!.path.substring(0, lastSeparator + 1) + newName; - _outFile!.copySync(newSourcePath); - CRFileSaver.saveFileWithDialog(SaveFileDialogParams( - sourceFilePath: newSourcePath, destinationFileName: newName)); + sourceFilePath: _outFile!.path, destinationFileName: newName)); } } on Exception catch (e, s) { Sentry.captureException(e, stackTrace: s); diff --git a/lib/ui/views/settings/settings_viewmodel.dart b/lib/ui/views/settings/settings_viewmodel.dart index 416068b6..e9bf7d80 100644 --- a/lib/ui/views/settings/settings_viewmodel.dart +++ b/lib/ui/views/settings/settings_viewmodel.dart @@ -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'); diff --git a/pubspec.yaml b/pubspec.yaml index 9ff628b0..f5aa6443 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ dependencies: app_installer: ^1.1.0 collection: ^1.16.0 cross_connectivity: ^3.0.5 - cr_file_saver: ^0.0.1+2 + cr_file_saver: ^0.0.2 device_apps: git: url: https://github.com/ponces/flutter_plugin_device_apps