-1

I know for swipe down detection there is onVerticalDragDown but for swipe up detection there is no onVerticalDragUp parameter in GestureDetector widget.

Yudhishthir Singh
  • 2,941
  • 2
  • 23
  • 42
Aadarsh Patel
  • 167
  • 4
  • 14

1 Answers1

3

You are looking for onPanUpdate method in GestureDetector class.

GestureDetector(onPanUpdate: (details) {
  if (details.delta.dx > 0)
    print("Dragging in +X direction");
  else
    print("Dragging in -X direction");

  if (details.delta.dy > 0)
    print("Dragging in +Y direction");
  else
    print("Dragging in -Y direction");
});

Note: Do not use this method with the ones that you are already using (onVerticalDragDown) or onVerticalDragUpdate().

Yudhishthir Singh
  • 2,941
  • 2
  • 23
  • 42