1.3.3 > 1.3.4 (#71)

* If file not choosen getFile() should return null

* minor fix

* fixes an issue where sometimes getFilePath could return a List instead of a String

* minor fixes

* Update README.md

* Fix for background activities trying to register the plugin (#66)

* Beta (#55)

* If picker is canceled in `getFile()`, it should return `null`

* Beta (#60)

* Added a check to registerWith to prevent background flutter view from trying to register the plugin, as there won't be any activity.

* 1.3.3 > 1.3.4
This commit is contained in:
Miguel Ruivo 2019-04-20 17:21:19 +01:00 committed by GitHub
parent 8f6c488fb4
commit 7751df32ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 4 deletions

View File

@ -1,3 +1,7 @@
## 1.3.4
**Bug fix:** Protects the `registrar.activity()` in the Android side of being accessed when it's `null`.
## 1.3.3
**Bug fixes**

View File

@ -10,10 +10,15 @@ A package that allows you to use a native file explorer to pick single or multip
First, add *file_picker* as a dependency in [your pubspec.yaml file](https://flutter.io/platform-plugins/).
```
file_picker: ^1.3.3
file_picker: ^1.3.4
```
### Android
Add `<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>` to your app `AndroidManifest.xml` file. This is required due to file caching when a path is required from a remote file (eg. Google Drive).
Add
```
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
```
before `<application>` to your app's `AndroidManifest.xml` file. This is required due to file caching when a path is required from a remote file (eg. Google Drive).
### iOS
Based on the location of the files that you are willing to pick paths, you may need to add some keys to your iOS app's _Info.plist_ file, located in `<project root>/ios/Runner/Info.plist`:

View File

@ -39,6 +39,13 @@ public class FilePickerPlugin implements MethodCallHandler {
/** Plugin registration. */
public static void registerWith(Registrar registrar) {
if (registrar.activity() == null) {
// If a background flutter view tries to register the plugin, there will be no activity from the registrar,
// we stop the registering process immediately because the ImagePicker requires an activity.
return;
}
final MethodChannel channel = new MethodChannel(registrar.messenger(), "file_picker");
channel.setMethodCallHandler(new FilePickerPlugin());

View File

@ -2,8 +2,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 extensions filtering support.
author: Miguel Ruivo <miguel@miguelruivo.com>
homepage: https://github.com/miguelpruivo/plugins_flutter_file_picker
version: 1.3.3
version: 1.3.4
dependencies:
flutter: