From 3fdc1770a3c8c514dbdb53813409744dfef3d104 Mon Sep 17 00:00:00 2001 From: Victor Carreras <34163765+vicajilau@users.noreply.github.com> Date: Tue, 25 Feb 2025 08:55:58 +0100 Subject: [PATCH] Update changes --- lib/_internal/file_picker_web.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/_internal/file_picker_web.dart b/lib/_internal/file_picker_web.dart index 66ad30b8..929e697d 100644 --- a/lib/_internal/file_picker_web.dart +++ b/lib/_internal/file_picker_web.dart @@ -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);