Sitemap

Everything You Need to Know About GestureDetector in Flutter

2 min readJul 15, 2022

Hi to everyone, in this article we are going to talk about GestureDetector.

So what is the Gesture Detector? How does it work?

Flutter provides some really amazing out-of-the-box widgets for handling user gestures and taps or touch events. This widget wrap your widgets so that they are able to respond to touch events.

The basic overview of gesture detector is a stateless widget which has parameters in its constructor for different touch events. GestureDetector provides more gestures, it’s a literally gesture detector.GestureDetector is used purely for detecting gestures and thus does not give any visual response (the Material Ink propagation or ripple effect is absent).

Below is the properties of the widget.

Below is a example of onTap,onDoubleTap and onLongPress

Output:

In the output you can see tap actions ,notice that no ripple effect is there.

You can understand each step when you start implementing it on your own. I have added comment lines. In case you are stuck at any point feel free to message me on LinkedIn.

Support Me:

Relax you are a Pro now! If you gain some knowledge from this article give me start 🌟🌟🌟 on gihub .

--

--

Mabud Alam
Mabud Alam

Written by Mabud Alam

Enthusiastic and experienced android and flutter developer. Always ready to learn latest technologies. Loves to write, educate and give back to community.

No responses yet