flutter_dropzone icon indicating copy to clipboard operation
flutter_dropzone copied to clipboard

Issue with multiple DropzoneView widgets on same page

Open sunilguptasg opened this issue 2 years ago • 4 comments

I have a form with multiple video and image fields (in this case two video and one image). All have the DropzoneView in a Stack.

The videos are in iFrames.

I get several errors:

1> The image does not display, just the videos. If I remove one of the video widget, the image is rendered.

2> In any case, when I push a camera widget and pop back I get errors like this: ══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════ The following IndexError was thrown during a scheduler callback: RangeError (index): Index out of range: index must not be negative: -1

Can you help identify the issue?

sunilguptasg avatar Apr 11 '22 12:04 sunilguptasg

If you could come up with a simple reproducible code, I could try it. :-)

deakjahn avatar Apr 11 '22 14:04 deakjahn

deakjahn - the code was really too complex for me to send in a testable form without significant effort. What I did was replace this with DropZone (https://pub.dev/packages/drop_zone) and got things working.

Fundamentally, multiple DropzoneView with iFrames on a page, then a navigator.push to a camera page, then pop, and the exception occurs.

I still use DropzoneView, but NOT for drag/drop - incidentally this component (when stacked on top of an iFrame) blocks clicks to be sent to the iFrame, so when I need this functionality, I add this to the stack on top of my iFrames.

Perhaps you can extract just that portion and make it available as a widget - there are a lot of people looking for this capability.

sunilguptasg avatar Apr 23 '22 13:04 sunilguptasg

same issue. It only happens in canvasKit rendering. try that

sgehrman avatar Jun 16 '22 05:06 sgehrman

Im using flutter 3.3, have multiple DropzoneView and might have issues related this which are like,

  • a File drop causes onDropMultiple
  • the argv of onDropMultiple are sometimes List of single File, but almost List of a String like "file://xxx/test.json"
  • the issues happens after deployed the result of "flutter build web"
  • meaning no above issues found while using "flutter run -d chrome"

Guessing its related to canvaskit? though the issues are there if I build with --web-render html

tf0054 avatar Sep 22 '22 13:09 tf0054