How to get Dismissable dragged amount before it's dismissed - Flutter

Viewed 1378

The Dismissible widget in Flutter gives you an onDismissed: (direction) {....} to tell you the direction it was dragged after it has been dismissed. How can I get the direction (or delta) the widget is currently being dragged?

I tried wrapping it in a GestureDectecor() which has onHorizontalDragStart: etc but it seems to stop the Dismissible from working (i.e. you can't drag it)

1 Answers

Wrap your Dismissible widget inside Listener and use the onPointerMove callBack.

  Listener(
            onPointerMove: (PointerMoveEvent event) {
              print("Event : $event");
            },
            child: Dismissible(
             ...
             ,
            ),
          )
Related