Hello FlutterFlow Community,
I'm working on making an image draggable using the Draggable widget, with the background state toggling when the image is dragged. Currently, I’ve set an onTapDown trigger on the image wrapped in the Draggable widget so that when tapped down, the page state changes, causing the background to disappear.
However, there are a few issues with this setup:
The drag does not start smoothly: Because I'm using the
onTapDowntrigger, I have to first tap, lift my finger, and then start dragging. This disrupts the natural flow of the drag gesture, leading to a suboptimal user experience.A firm press is required: The drag and background toggle only activate if I press down firmly on the image. This makes the drag interaction feel less smooth and intuitive.
Re-showing the background when the drag is canceled: Ideally, I’d like the background to reappear (i.e.,
page statereturning tofalse) if the drag is canceled or if the user releases the drag midway. However, detecting this cancel action reliably has been challenging, and the state doesn’t always reset as expected.
The ideal behavior would be for the drag to start immediately upon touching the image, the background to disappear, and then for the background to reappear once the drag is completed or canceled. Due to limitations with the current onTapDown trigger and the Draggable widget, however, the background toggle and drag action are not smoothly linked, resulting in an awkward interaction.