Adds temporary workaround due to Flutter issue #49364
This commit is contained in:
parent
8f54c4fd4c
commit
02b3056a1e
|
@ -1,3 +1,6 @@
|
||||||
|
## 1.9.0+1
|
||||||
|
Adds a temporary workaround on Android where it can trigger `onRequestPermissionsResult` twice, related to Flutter issue [49365](https://github.com/flutter/flutter/issues/49365) for anyone affected in Flutter versions below 1.14.6.
|
||||||
|
|
||||||
## 1.9.0
|
## 1.9.0
|
||||||
Adds `clearTemporaryFiles()` that allows you to explicitly remove cached files — on Android applies typically to those picked from remote providers, on iOS _all_ picked files are cached.
|
Adds `clearTemporaryFiles()` that allows you to explicitly remove cached files — on Android applies typically to those picked from remote providers, on iOS _all_ picked files are cached.
|
||||||
|
|
||||||
|
|
|
@ -155,9 +155,14 @@ public class FilePickerDelegate implements PluginRegistry.ActivityResultListener
|
||||||
private void startFileExplorer() {
|
private void startFileExplorer() {
|
||||||
final Intent intent;
|
final Intent intent;
|
||||||
|
|
||||||
|
// Temporary fix, remove this null-check after Flutter Engine 1.14 has landed on stable
|
||||||
|
if (type == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
intent = new Intent(Intent.ACTION_GET_CONTENT);
|
intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||||
final Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath() + File.separator);
|
final Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath() + File.separator);
|
||||||
Log.d(TAG, "Type" + type);
|
Log.d(TAG, "Selected type " + type);
|
||||||
intent.setDataAndType(uri, this.type);
|
intent.setDataAndType(uri, this.type);
|
||||||
intent.setType(this.type);
|
intent.setType(this.type);
|
||||||
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, this.isMultipleSelection);
|
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, this.isMultipleSelection);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
name: file_picker
|
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.
|
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
|
homepage: https://github.com/miguelpruivo/plugins_flutter_file_picker
|
||||||
version: 1.9.0
|
version: 1.9.0+1
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
|
|
Loading…
Reference in New Issue