How to add a File Picker plugin in Flutter?

2020-04-02 14:56发布

问题:

I am creating a Flutter project in which, I have a piece of data (JSON) that I want to Import from and Export to a location the user wants to. In order to achieve this, I require a File Picker plugin in Flutter. Now, I searched the Dart Packages repository for "file picker" but didn't find one.

Is there a way to get a File Picker that looks like this:

or even this...

The first screenshot is preferable for me as it allows file selection from different sources (like Drive).

Also, since I want to Export the data, I might want a Folder Picker too. ;)
But, if there is any other alternative to Folder Picker. I'd be happy to know...

回答1:

I've created a file_picker plugin some time ago in order to make it possible to pick (both on iOS and Android) absolute paths and then loaded it with Flutter.

You can check it here: https://pub.dartlang.org/packages/file_picker



回答2:

I'm in the exact same boat as you, haha!

I noticed documents_picker 0.0.2. It allows the user to pick multiple files, and it seems to fit the need!

check it out: https://pub.dartlang.org/packages/documents_picker#-readme-tab-



回答3:

Here's a better document picker. It looks like the native document picker from the Storage Access Framework, which is what you have in your picture. flutter_document_picker