Adds temporary workaround due to Flutter issue #49364

This commit is contained in:
Miguel Ruivo 2020-05-04 23:03:57 +01:00
parent 8f54c4fd4c
commit 02b3056a1e
3 changed files with 10 additions and 2 deletions

View File

@ -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
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.

View File

@ -155,9 +155,14 @@ public class FilePickerDelegate implements PluginRegistry.ActivityResultListener
private void startFileExplorer() {
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);
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.setType(this.type);
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, this.isMultipleSelection);

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