Closed rustiever closed 3 years ago
I can't really see much need for them at the present. The platform views support receiveing it, so I simply included that it can be passed but I'm not sure it serves any real purpose here. :-)
I'm newbie, sorry if it was silly question, please tell me how can i achieve onTap on DropZoneView()
You don't. You wrap the whole thing into a GestureDetector
and use that:
GestureDetector(
onTap: () {},
child: DropzoneView(
...
You'll get used to it. :-) This is the stardard way of doing things in Flutter, if you want to add some functionality (even if it's as simple as centering or aligning your widget to left or right), most of the time, you just wrap it into another widget with that functionality. You don't have to worry, that won't mean it will be slow if the tree is too deep. It's conceived this way and it does it rather well.
Thank You so much for your help and example, So Kind of you brother
But why gesturerecognizer parameter, if you don't mind, please explain me
Because, as I said above, the underlying platform view has such a parameter and the usual routine is to allow the user to pass in anything that might be passed on. I never tried if that could be used for any real purpose, especially considering that it requires a Set
of Factory
of recognizers, not just a single one...
yeah buddy, i couldn't figure how to use ,but i'm happy with your ans and i got what i wanted and closing the issue
There seems to be an issue with using GestureDetector in conjunction with DropzoneView. Specifically, wrapping DropzoneView with GestureDetector and providing an onTap callback does not work as expected:
GestureDetector(
onTap: () {},
child: DropzoneView(
// ... other parameters
),
)
However, using the Listener widget with the onPointerDown callback as a workaround does function correctly:
Listener(
onPointerDown: (details) {
_pickFiles(); // Triggering the file picker when the area is tapped
},
child: DropzoneView(
// ... other parameters
),
)
This suggests that DropzoneView might be consuming tap events, preventing GestureDetector from detecting them. A direct onTap or onClicked functionality for DropzoneView would be immensely helpful.
so that it will be helpful how to implement them
Thank You