From dee3b2efe945ef44645448f7914a1bea0bc5f0d5 Mon Sep 17 00:00:00 2001 From: Miguel Ruivo Date: Wed, 26 May 2021 11:51:41 +0100 Subject: [PATCH] Fixes #725 --- CHANGELOG.md | 3 +++ lib/src/file_picker.dart | 6 ++++-- lib/src/file_picker_io.dart | 2 +- pubspec.yaml | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1b4e85..035aefe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 3.0.2+2 +- Fixes [#725](https://github.com/miguelpruivo/flutter_file_picker/issues/725). + ## 3.0.2 ##### General - `name` and `size` properties are now non-nullable types. diff --git a/lib/src/file_picker.dart b/lib/src/file_picker.dart index 2312e6f..58ca822 100644 --- a/lib/src/file_picker.dart +++ b/lib/src/file_picker.dart @@ -85,7 +85,8 @@ abstract class FilePicker extends PlatformInterface { /// of it whenever needed. However, this will force the cleanup if you want to manage those on your own. /// /// Returns [true] if the files were removed with success, [false] otherwise. - Future clearTemporaryFiles() async => throw UnimplementedError('clearTemporaryFiles() has not been implemented.'); + Future clearTemporaryFiles() async => throw UnimplementedError( + 'clearTemporaryFiles() has not been implemented.'); /// Selects a directory and returns its absolute path. /// @@ -93,5 +94,6 @@ abstract class FilePicker extends PlatformInterface { /// Returns [null] if folder path couldn't be resolved. /// /// Note: Some Android paths are protected, hence can't be accessed and will return `/` instead. - Future getDirectoryPath() async => throw UnimplementedError('getDirectoryPath() has not been implemented.'); + Future getDirectoryPath() async => + throw UnimplementedError('getDirectoryPath() has not been implemented.'); } diff --git a/lib/src/file_picker_io.dart b/lib/src/file_picker_io.dart index 2b9e9f7..37784fb 100644 --- a/lib/src/file_picker_io.dart +++ b/lib/src/file_picker_io.dart @@ -70,7 +70,7 @@ class FilePickerIO extends FilePicker { bool? withReadStream, ) async { final String type = describeEnum(fileType); - if (type != FileType.custom && (allowedExtensions?.isNotEmpty ?? false)) { + if (type != 'custom' && (allowedExtensions?.isNotEmpty ?? false)) { throw Exception( 'You are setting a type [$fileType]. Custom extension filters are only allowed with FileType.custom, please change it or remove filters.'); } diff --git a/pubspec.yaml b/pubspec.yaml index d23734d..d6329ce 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: file_picker description: A package that allows you to use a native file explorer to pick single or multiple absolute file paths, with extension filtering support. homepage: https://github.com/miguelpruivo/plugins_flutter_file_picker -version: 3.0.2 +version: 3.0.2+2 dependencies: flutter: