Flutter Gestures with example

Hello flutter dev’s, here we will discuss Flutter Gestures with example. Generally, it is important to have easy interactions between user and application. In short, any application without gestures is incomplete. In everyday life, every user has devices that interact with them. Therefore, any application that interacts with humans in few taps makes the application more attractive. These gestures can be anything such as Tap, drag, and slide.

Flutter gestures types:

Flutter gestures have two categories of layers. These layers are the bridge between application and user gestures.

Pointer:

A pointer is a primary layer for the flutter gestures. This layer holds the raw data from the application point of view. It includes the events. In addition, these events inform which event has been fired. Events such as tap or mouse click.

Pointer has 4 types of events that are more popular:

- PointerDownEvents: This event simply detects the location on the screen. In short, it detects the fingertip touch.
- PointerMoveEvents: As the name suggests, this property detects the moving location from one end to another end.
- PointerUpEvents: This event detects that the user’s finger is up from the surface of the screen. In summary, we can say it catches the event when the user releases the screen surface.
- PointerCancelEvents: This event helps us when any pointer interaction is canceled.

Code:

import ‘package:flutter/gestures.dart’;
import ‘package:flutter/material.dart’;

void

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store