Updates iOS media picker to launch in app context (instead of modal)

This commit is contained in:
Miguel Ruivo 2020-10-20 11:19:20 +01:00
parent a4d5478669
commit 000f05833e
4 changed files with 23 additions and 19 deletions

View File

@ -1,3 +1,7 @@
## 2.0.8+1
- iOS: Updates media picker to launch in app context (instead of modal).
- Minor update to README file.
## 2.0.8
Fixes an issue on iOS 14, where canceling with swipe gestures, could result in cancel event not being dispatched. ([#431](https://github.com/miguelpruivo/flutter_file_picker/issues/431)).

View File

@ -15,21 +15,18 @@
</p>
# File Picker
A package that allows you to use a native file explorer to pick single or multiple absolute file paths, with extensions filtering support.
A package that allows you to use the native file explorer to pick single or multiple files, with extensions filtering support.
## Currently supported features
* Load files from **cloud files** (GDrive, Dropbox, iCloud)
* Load files from a **custom format** by providing a list of file extensions (pdf, svg, zip, etc.)
* Load files from **multiple files** optionally, supplying file extensions
* Load files from **media** (video & image only)
* Load files from **audio** only
* Load files from **image** only
* Load files from **video** only
* Load files from **directory**
* Load files from **any**
* Load files data immediately to memory (`Uint8List`);
* Supports web;
* Supports desktop through **go-flutter** (MacOS, Windows, Linux)
* Uses OS default native pickers
* Pick files using **custom format** filtering — you can provide a list of file extensions (pdf, svg, zip, etc.)
* Pick files from **cloud files** (GDrive, Dropbox, iCloud)
* Single or multiple file picks
* Different default type filtering (media, image, video, audio or any)
* Picking directories
* Flutter Web
* Desktop (MacOS, Linux and Windows through Flutter Go)
* Load file data immediately into memory (`Uint8List`) if needed;
If you have any feature that you want to see in this package, please feel free to issue a suggestion. 🎉
@ -59,6 +56,8 @@ FilePickerResult result = await FilePicker.platform.pickFiles();
if(result != null) {
File file = File(result.files.single.path);
} else {
// User canceled the picker
}
```
#### Multiple files
@ -67,6 +66,8 @@ FilePickerResult result = await FilePicker.platform.pickFiles(allowMultiple: tru
if(result != null) {
List<File> files = result.paths.map((path) => File(path)).toList();
} else {
// User canceled the picker
}
```
#### Multiple files with extension filter
@ -88,6 +89,8 @@ if(result != null) {
print(file.size);
print(file.extension);
print(file.path);
} else {
// User canceled the picker
}
```

View File

@ -148,11 +148,8 @@
PHPickerViewController *pickerViewController = [[PHPickerViewController alloc] initWithConfiguration:config];
pickerViewController.delegate = self;
[self.viewController presentViewController:pickerViewController animated:YES completion:^{
Log(@"Media picker canceled");
self->_result(nil);
self->_result = nil;
}];
pickerViewController.modalPresentationStyle = UIModalPresentationCurrentContext;
[self.viewController presentViewController:pickerViewController animated:YES completion:nil];
return;
}
#endif

View File

@ -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: 2.0.8
version: 2.0.8+1
dependencies:
flutter: