concept gesture in category flutter

appears as: gestures, gesture
Flutter in Action

This is an excerpt from Manning's book Flutter in Action.

GestureDetector needs only two things passed to it: a widget (its child) and a callback to correspond to a gesture. Here’s an example:

GestureDetector(
    onTap: () => print("tapped!"),
    child: Text("Tap Me"),
);

Although GestureDetector needs only one gesture callback, it can be passed many different callbacks and will respond differently based on the gesture it detects. These are some of the nearly 30 gestures it can work with:

5.1. User interaction and gestures

Gestures are any kind of interaction event: taps, drags, pans, and more. First I’ll cover how you detect and respond to these user gestures. To be honest, though, there isn’t much involved here. Flutter has a convenience widget that allows you to add gesture detectors to any location of the widget tree that you’d like.

Without knowing it, perhaps, you’ve already used gestures. All the button widgets that have onPressed and onTap are just convenient wrappers around gesture detectors. Gesture detectors are used in a similar way.