Closed crizant-mpower closed 11 months ago
@crizant-mpower Yep but I'm not yet sure what the best solution would be. onDrop()
has a File
as second argument. We could change it to dynamic
(just like onDropMultiple()
) but that would be a breaking change of the interface. We could also add a different onDrop()
variant but I can't really see why.
Wait a minute... The handler itself is OK, it was an intermediate function somewhere with the File
argument...
Check out the changes, please.
Thanks. I'm fine with the changes. Looking forward to the next release.
Published now.
Sorry, it seems you forgot to update the onDropMultiple
method.
When I drop text, the onDropMultiple
method is not invoked.
Oh, dear me, that'll be an async problem with JavaScript...
@crizant-mpower OK, this is definitively something I don't want to publish before you test it. :-) See https://github.com/deakjahn/flutter_dropzone/commit/72300858eb32c865fbf7b2f10624dda5a82791a1
Basically, getting the string is async so we actually went on to fire (or not fire) onDropMultiple
before the string got a chance to be set (files are not problematic because, for some obscure reason, getting them is sync). I added a private helper function to make getting the string synchronous. The change is straightforward and seems to work for my simple tests but let's be sure first...
@crizant-mpower OK, this is definitively something I don't want to publish before you test it. :-) See 7230085
Basically, getting the string is async so we actually went on to fire (or not fire)
onDropMultiple
before the string got a chance to be set (files are not problematic because, for some obscure reason, getting them is sync). I added a private helper function to make getting the string synchronous. The change is straightforward and seems to work for my simple tests but let's be sure first...
I tested and it works like a charm. 🎉
Then it's released again, thanks.
Select some text on the address bar, then drag it over the dropzone, the following error is thrown: