diff --git a/packages/reactive_file_picker/CHANGELOG.md b/packages/reactive_file_picker/CHANGELOG.md index d1f20bd..aa149bb 100644 --- a/packages/reactive_file_picker/CHANGELOG.md +++ b/packages/reactive_file_picker/CHANGELOG.md @@ -1,3 +1,7 @@ +## [3.0.3] + +* MultiFile.fromFiles allow null + ## [3.0.2] * MultiFile.fromFile factory method diff --git a/packages/reactive_file_picker/lib/multi_file.dart b/packages/reactive_file_picker/lib/multi_file.dart index 395548a..ee060a8 100644 --- a/packages/reactive_file_picker/lib/multi_file.dart +++ b/packages/reactive_file_picker/lib/multi_file.dart @@ -12,8 +12,8 @@ class MultiFile with _$MultiFile { @Default([]) List platformFiles, }) = _MultiFile; - factory MultiFile.fromFiles(List files) => MultiFile( - files: files.whereType().toList(), + factory MultiFile.fromFiles(List? files) => MultiFile( + files: (files ?? []).whereType().toList(), ); factory MultiFile.fromFile(T? file) => MultiFile( files: [file].whereType().toList(), diff --git a/packages/reactive_file_picker/pubspec.yaml b/packages/reactive_file_picker/pubspec.yaml index a497504..ffb6a43 100644 --- a/packages/reactive_file_picker/pubspec.yaml +++ b/packages/reactive_file_picker/pubspec.yaml @@ -1,6 +1,6 @@ name: reactive_file_picker description: Wrapper around file_picker to use with reactive_forms. -version: 3.0.2 +version: 3.0.3 repository: https://github.com/artflutter/reactive_forms_widgets/tree/master/packages/reactive_file_picker issue_tracker: https://github.com/artflutter/reactive_forms_widgets/issues