Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/services/csv/csv_file_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ class CSVFilePicker {

// Share exported CSV file
static Future<void> saveCSVFile(String csv, BuildContext context) async {
String? selectedDirectory;
try {
// Prompt the user to select a directory
String? selectedDirectory = await FilePicker.platform.getDirectoryPath();
selectedDirectory = await FilePicker.platform.getDirectoryPath();
if (selectedDirectory == null) {
// User canceled the picker
return;
Expand All @@ -76,7 +77,10 @@ class CSVFilePicker {
}
} catch (e) {
if (context.mounted) {
showSnackBar(context, message: 'Error saving file: ${e.toString()}');
String errorMessage =
'Cannot save the file here, please create or select a folder in Downloads or Documents. Error: ${e.toString()}';

showSnackBar(context, message: errorMessage);
}
}
}
Expand Down