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:
parent
8f6c488fb4
commit
7751df32ad
|
@ -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
|
## 1.3.3
|
||||||
|
|
||||||
**Bug fixes**
|
**Bug fixes**
|
||||||
|
|
|
@ -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/).
|
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
|
### 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
|
### 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`:
|
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`:
|
||||||
|
|
|
@ -39,6 +39,13 @@ public class FilePickerPlugin implements MethodCallHandler {
|
||||||
|
|
||||||
/** Plugin registration. */
|
/** Plugin registration. */
|
||||||
public static void registerWith(Registrar registrar) {
|
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");
|
final MethodChannel channel = new MethodChannel(registrar.messenger(), "file_picker");
|
||||||
channel.setMethodCallHandler(new FilePickerPlugin());
|
channel.setMethodCallHandler(new FilePickerPlugin());
|
||||||
|
|
||||||
|
|
|
@ -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.
|
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>
|
author: Miguel Ruivo <miguel@miguelruivo.com>
|
||||||
homepage: https://github.com/miguelpruivo/plugins_flutter_file_picker
|
homepage: https://github.com/miguelpruivo/plugins_flutter_file_picker
|
||||||
version: 1.3.3
|
version: 1.3.4
|
||||||
|
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
|
|
Loading…
Reference in New Issue