deakjahn / flutter_dropzone

A drag-and-drop Flutter plugin (Web). Only web and only from outside into Flutter.
https://pub.dev/packages/flutter_dropzone
90 stars 41 forks source link

Disable multiple file selection #85

Open DonRubiczek opened 5 months ago

DonRubiczek commented 5 months ago

Is it possible to disable multiple file selection?

DonRubiczek commented 4 months ago

Will this be possible in future versions?

deakjahn commented 4 months ago

pickFiles() has a passed parameter, multiple. All you need to do is to set it to false.

DonRubiczek commented 4 months ago

Yes, but you are talking about using function to open dialog and pick files, i am talking about dropping multiple files to dropzone. There is no such parameter as multiple in DropzoneView. Is it possible to somehow configure DropzoneView to accept only single files?

deakjahn commented 4 months ago

Oh, I see. Basically, the plugin does nothing itself, it just uses the drag-and-drop provided by the browser. And it looks like that doesn't have a setting to restrict it. But we have both onDrop and onDropMultiple. Do you only use the first?

Actually, as I check now, you could only use onDropMultiple always, even if it sounds counter-intuitive. And only use the first item from the list, even if there are more than one.