touchable
touchable copied to clipboard
Can you add GestureDragEndCallback?
GestureDragEndCallback doesn't contain the location details (x and y positions) which limits me from detecting which shape got this event.
You can still achieve this by using the onTapUp callback and keeping a flag that becomes true once the GestureStart event is fired.
@nateshmbhat I have tried to implement this using the onTapUp callback, but this callback is only fired when I do a quick click on the shape. It isn't fired when I stop dragging the shape.
Do you have any idea why this might be?
Thanks for any help!
Hi, I'm also looking for this feature. For me personally, it does not really matter where the "end" event was I just need it recorded.
@nateshmbhat I have tried to implement this using the onTapUp callback, but this callback is only fired when I do a quick click on the shape. It isn't fired when I stop dragging the shape.
Do you have any idea why this might be?
Thanks for any help!
If you're still fighting with this I just wrapped the CanvasTouchDetector in a Listener widget and I'm listening for onPointerUp event and just passing it on in the meantime. Hope that helps!
Also request this feature
Would be great, makes drag & drop behaviour possible.
@nateshmbhat I have tried to implement this using the onTapUp callback, but this callback is only fired when I do a quick click on the shape. It isn't fired when I stop dragging the shape.
Do you have any idea why this might be?
Thanks for any help!
Solved this issue by creating another transparent Rect that acts as a background and setting all other shapes with translucent touch detections. Then when a shape is touched a flag is set so that when the background recieves the touch it acts correctly according to the shape that was touched.
I still wish there was a onPanEnd callback on shapes.
I still wish there was a onPanEnd callback on shapes.
me too. I can't control this action. very laggy when try moving the canvas inside.
What if we save a shape when drag starts on it and call onPanEnd on that shape when drag ends? I tried to implement this feature for drawRRect only so far: https://github.com/autolainen/touchable Please have a look and if my approach is acceptable I'll implement this feature for all the draw* methods.
Created a PR: https://github.com/nateshmbhat/touchable/pull/61