Skip to content

Commit

Permalink
Update changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vicajilau committed Feb 25, 2025
1 parent 9e1e4bf commit 3fdc177
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/_internal/file_picker_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,14 @@ class FilePickerWeb extends FilePicker {
);
}

if (fileName == null || p.extension(fileName).isEmpty) {
if (fileName == null || fileName.isEmpty) {
throw ArgumentError(
'The "fileName" parameter is required and must include a valid file extension (e.g., ".txt", ".pdf") when using saveFile on web.');
'A file name is required when saving a file on the web.');
}

if (p.extension(fileName).isEmpty) {
throw ArgumentError(
'The file name should include a valid file extension.');
}

final blob = Blob([bytes.toJS].toJS);
Expand Down

0 comments on commit 3fdc177

Please sign in to comment.