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

How to handle unpicked files? #74

Open amiitpatil opened 7 months ago

amiitpatil commented 7 months ago

await never resolves if user didn't pick a file Print statement will not get executed if user closes the picker dialog, also no error is thrown

Future fun()async{
final files = await _dropzoneController?.pickFiles();
print("reached here");
}

cc: @deakjahn

deakjahn commented 7 months ago

Could you try this fix?

amiitpatil commented 7 months ago

Hi @deakjahn , Thanks for the quick response!

I have set dependancy to latest a643d6 commit , and tested again after flutter clean and pub get Issue is still reproducible. FYI I'm using chrome.

flutter_dropzone:
    git: 
      url: https://github.com/deakjahn/flutter_dropzone.git
      ref: a643d60579214616964e7277d4634ebc5859f8af
      path: flutter_dropzone
deakjahn commented 7 months ago

Could you check in your local .pub cache that you actually have the source with the small modification in the commit? Or maybe simply insert the few lines there and run it with the new callback added?

amiitpatil commented 7 months ago

Can confirm lines from commit a643d60 do exist in the .pub cache.

Also adding to it, When user cancels the file picker, and if I try to hot refresh the web app, I can see the choose file buttons for few seconds, until reload completes.

image

deakjahn commented 7 months ago

The documentation looks quite explicit. What happens if you put a breakpoint on line 81, inside the cancel handler?