diff --git a/.gitignore b/.gitignore index 1354c8e..db81ab8 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ example/ios/Flutter/flutter_export_environment.sh example/.flutter-plugins-dependencies file_picker/example/.flutter-plugins-dependencies file_picker/example/ios/Flutter/flutter_export_environment.sh +example/macos diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e29933..1a580ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ -## 4.0.0+1 -Overrides equality and toString for `platform_file` and `file_picker_result` for better comparison different results. +## 4.0.1 +##### General +Overrides equality and toString for `platform_file` and `file_picker_result` for better comparison different results. Thank you @Nolence. +##### iOS +- Changes the presentation type of the picker from `UIModalPresentationCurrentContext` to `UIModalPresentationAutomatic` ([#813](https://github.com/miguelpruivo/flutter_file_picker/issues/813)). + +##### Web +- Fixes regression of [#746](https://github.com/miguelpruivo/flutter_file_picker/issues/746). +- Updates exception text when trying to access `path` on Web. Thank you @maxzod. ## 4.0.0 ### Desktop support added for all platforms (MacOS, Linux & Windows) ([#271](https://github.com/miguelpruivo/flutter_file_picker/issues/271)) 🎉 diff --git a/example/lib/generated_plugin_registrant.dart b/example/lib/generated_plugin_registrant.dart index 7fe6f55..7a662b4 100644 --- a/example/lib/generated_plugin_registrant.dart +++ b/example/lib/generated_plugin_registrant.dart @@ -2,10 +2,9 @@ // Generated file. Do not edit. // -// ignore_for_file: directives_ordering // ignore_for_file: lines_longer_than_80_chars -import 'package:file_picker/src/file_picker_web.dart'; +import 'package:file_picker/_internal/file_picker_web.dart'; import 'package:flutter_web_plugins/flutter_web_plugins.dart'; diff --git a/ios/Classes/FilePickerPlugin.m b/ios/Classes/FilePickerPlugin.m index 5aea407..b082b62 100644 --- a/ios/Classes/FilePickerPlugin.m +++ b/ios/Classes/FilePickerPlugin.m @@ -134,7 +134,6 @@ } self.documentPickerController.delegate = self; - self.documentPickerController.modalPresentationStyle = UIModalPresentationCurrentContext; self.galleryPickerController.allowsEditing = NO; [self.viewController presentViewController:self.documentPickerController animated:YES completion:nil]; @@ -157,7 +156,6 @@ PHPickerViewController *pickerViewController = [[PHPickerViewController alloc] initWithConfiguration:config]; pickerViewController.delegate = self; - pickerViewController.modalPresentationStyle = UIModalPresentationCurrentContext; [self.viewController presentViewController:pickerViewController animated:YES completion:nil]; return; } @@ -173,7 +171,6 @@ self.galleryPickerController = [[UIImagePickerController alloc] init]; self.galleryPickerController.delegate = self; - self.galleryPickerController.modalPresentationStyle = UIModalPresentationCurrentContext; self.galleryPickerController.videoQuality = UIImagePickerControllerQualityTypeHigh; switch (type) { @@ -222,7 +219,7 @@ if (@available(iOS 11.0, *)) { DKImageAssetExporterConfiguration * exportConfiguration = [[DKImageAssetExporterConfiguration alloc] init]; - exportConfiguration.imageExportPreset = allowCompression ? UIImagePickerControllerImageURLExportPresetCompatible : UIImagePickerControllerImageURLExportPresetCurrent; + exportConfiguration.imageExportPreset = allowCompression ? DKImageExportPresentCompatible : DKImageExportPresentCurrent; exportConfiguration.videoExportPreset = allowCompression ? AVAssetExportPresetHighestQuality : AVAssetExportPresetPassthrough; dkImagePickerController.exporter = [dkImagePickerController.exporter initWithConfiguration:exportConfiguration]; } @@ -284,7 +281,6 @@ self.audioPickerController.delegate = self; self.audioPickerController.showsCloudItems = YES; self.audioPickerController.allowsPickingMultipleItems = isMultiPick; - self.audioPickerController.modalPresentationStyle = UIModalPresentationCurrentContext; [self.viewController presentViewController:self.audioPickerController animated:YES completion:nil]; } diff --git a/lib/src/file_picker_web.dart b/lib/_internal/file_picker_web.dart similarity index 100% rename from lib/src/file_picker_web.dart rename to lib/_internal/file_picker_web.dart diff --git a/lib/src/file_picker_result.dart b/lib/src/file_picker_result.dart index 009af71..03c8649 100644 --- a/lib/src/file_picker_result.dart +++ b/lib/src/file_picker_result.dart @@ -31,7 +31,9 @@ class FilePickerResult { @override bool operator ==(Object other) { - if (identical(this, other)) return true; + if (identical(this, other)) { + return true; + } return other is FilePickerResult && listEquals(other.files, files); } diff --git a/lib/src/platform_file.dart b/lib/src/platform_file.dart index 58fa162..d0c907b 100644 --- a/lib/src/platform_file.dart +++ b/lib/src/platform_file.dart @@ -62,7 +62,9 @@ class PlatformFile { @override bool operator ==(Object other) { - if (identical(this, other)) return true; + if (identical(this, other)) { + return true; + } return other is PlatformFile && other.path == path && diff --git a/pubspec.yaml b/pubspec.yaml index c892848..3a09301 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: A package that allows you to use a native file explorer to pick sin homepage: https://github.com/miguelpruivo/plugins_flutter_file_picker repository: https://github.com/miguelpruivo/flutter_file_picker issue_tracker: https://github.com/miguelpruivo/flutter_file_picker/issues -version: 4.0.0+1 +version: 4.0.1 dependencies: flutter: @@ -30,10 +30,10 @@ flutter: pluginClass: FilePickerPlugin web: pluginClass: FilePickerWeb - fileName: src/file_picker_web.dart + fileName: _internal/file_picker_web.dart macos: default_package: file_picker windows: default_package: file_picker linux: - default_package: file_picker \ No newline at end of file + default_package: file_picker