flutterdismissible

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


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)


Solution

  • Dismissible has onUpdate callback that reports progress:

    onUpdate: (details) {
      print("onUpdate : ${details.progress}");
    },