7

I have a button on screen, when you click button I need to open some folder picker. I have searched for package, but I didn't found any package that also support Android and iOS. Does someone knows some package who will resolve this problem, or something I could use to make solution of picking folder on iOS?

EDIT:

I found way to get directory picker functionality,I didn't test on iOS but in documentation says it works on both (Android and iOS).

String path = await FilePicker.platform.getDirectoryPath();

With this line above you get new screen to select your directory and get a path like result from that Future.

This is solved using file_picker package.

savke
  • 83
  • 1
  • 4

1 Answers1

8

Use the package file_picker.

Easy to use:

FilePickerResult? result = await FilePicker.platform.pickFiles();

if(result != null) {
   File file = File(result.files.single.path);
} else {
   // Do something else...
}