Skip to main content
The GestureDetector widget in Stac allows you to detect various gestures and user interactions within your application. It wraps Flutter’s native GestureDetector widget, providing a JSON-based interface to handle touch events, taps, drags, and more.

Usage

To use a GestureDetector in your Stac, specify the widget type as “gestureDetector” and provide a child widget along with any gesture callbacks you want to handle.

Properties

Child Widget

Tap Gestures

Secondary and Tertiary Tap Gestures

Long Press Gestures

Secondary and Tertiary Long Press Gestures

Drag Gestures

Force Press Gestures

Other Properties

Examples

Simple Tap Example

Drag Example

Long Press Example

Action Handling

Each gesture callback in Stac GestureDetector accepts an action object that defines what should happen when the gesture is detected. This can be a navigation action, showing a dialog, executing a custom function, or any other action supported by your Stac application. For more information on actions, see the Actions documentation.