flutter_dropzone
flutter_dropzone copied to clipboard
Proper example when there're other widgets in the `Stack` with `DropzoneView`
According to the example in the README, the right way to use the widget is -
Stack(
children: [
DropzoneView(...),
Center(child: Text('Drop files here')),
],
)
In many cases, DropzoneView
is used in Stack
with other widgets on top of it but there no example for it. Something like -
Stack(
children: [
DropzoneView(...),
// Other Widgets
Center(child: Text('Drop files here')),
],
)
But when there's SelectionArea
in the widget above it, for some reason DropzoneView
doesn't seem to work above it.
I solved this issue by keeping the DropzoneView
on top of the rest of widgets and wrapping it with IgnorePointer
. So, we could add an example in the README like -
Stack(
children: [
// Other Widgets
IgnorePointer(
child: DropzoneView(...),
),
if(isHovered)
Center(child: Text('Drop files here')),
],
)
Use the onHover
, onDrop
and onLeave
and set the state for the variable isHovered
You sir, are a genius. Thanks from Nigeria!