Gestures are to interact with applications. You can use it for touch-base devices in applications. You can perform touch on your mobile applications like physical interaction for swiping, taping, etc. You can also use it for gaming and other features of applications.
There are many types of gestures:
- Tap: Touching the surface of the physical device.
- Double Tap: Tapping twice in a short time.
- Drag: Touching the surface of the device with a fingertip and moving on the physical device.
- Flick: Simple to drag on the device.
- Pinch: Pinching the surface of the device using two fingers.
- Zoom: Opposite of pinching.
The GestureDetector widget in Flutter is for detecting physical touch. In this case, the widget is supposed to experience a gesture.
List of GestureDetector events:
Tap
- onTap
- onTapCancel
- onTapUp
- onTapDown
Double tap
- onDoubleTap
Long press
- onLongPress
Vertical drag
- onVerticalDragStart
- onVerticallDragUpdate
- onVerticalDragEnd
Horizontal drag
- onHorizontalDragStart
- onHorizontalDragUpdate
- onHorizontalDragEnd
Pan
- onPanStart
- onPanUpdate
- onPanEnd
Example of Gesturedetector
Happy coding!