Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter folder picker

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.

like image 585
savke Avatar asked Jun 24 '26 03:06

savke


1 Answers

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...
}
like image 148
Hylke Reinders Avatar answered Jun 27 '26 01:06

Hylke Reinders



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!