google / flutter-desktop-embedding

Experimental plugins for Flutter for Desktop
Apache License 2.0
7.1k stars 607 forks source link

[file_chooser] Allow choosing files and directories simultaneously #813

Closed jagmit closed 3 years ago

jagmit commented 3 years ago

It would be nice to allow configuring the file chooser in such a way that both files and directories could be chosen in it simultaneously. Currently setting the canSelectDirectories flag to true or false causes the file chooser to allow only directories or files.

For macOS this is technically possible, NSOpenPanel allows setting the canChooseFiles and canChooseDirectories flags simultaneously (this line would need to be changed).

I was not able to check whether the native file chooser dialogs on Windows and Linux allow this, but I would love to help implement this issue if this is regarded as something useful.

stuartmorgan commented 3 years ago

That doesn't work on Windows, and IIRC it didn't on Linux either, which is why macOS is set up that way; it seemed less confusing to have the functionality be consistent across the desktop platforms.

There will be no further functionality changes to file_chooser however, as it will be replaced with https://github.com/flutter/plugins/tree/master/packages/file_selector shortly; new requests like this should be filed against that plugin.