flutter_file_picker
flutter_file_picker copied to clipboard
How to pick files or directory?
I know we can use pickFiles()
to open file picker and getDirectoryPath()
to choose a directory but my use case allows user to select files or directory or both at the same time. How can I achieve this with this plugin?
For example, I also implemented drag and drop files support using desktop_drop package which supports both files and directory dropping. So when I drop things, it gives me List<XFile>
where can contain directories if I have selected any. I can't do this with this plugin. A lot of native apps does this.
I have tested this on MacOS. pickFiles()
doesn't allow selecting directories too. Only files.
I'd like to allow both at the same time. Can you please help?
This issue is stale because it has been open for 14 days with no activity.
Any updates?
Which platform are you trying this on?
@miguelpruivo I have the same use-case as OP and can confirm that exactly what they described happens when using macOS (Monterey 12.6).
With pickFiles
, when highlighting a directory and clicking Choose
, the directory is simply opened as if I had double-clicked it, rather than being returned.
With getDirectoryPath
, all files are grayed out and thus cannot be selected. Also, it is not possible to select multiple folders at once.
This issue is stale because it has been open for 14 days with no activity.
This issue is stale because it has been open for 14 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
up
@miguelpruivo can you reopen this issue?
This was immediately the first thing i realized was missing. Need a way to select a mixture of multiple files and folders in the same picker window. The native picker on macOS has support for this at least.
Without this feature, opening av picker becomes a much worse experience, compared to drag and drop. But some people are not tech savvy enough to perform a drop and drop, especially not on a small laptop where cmd+tab needs to be involved at the same time when dragging.
🤞🏻