OnGesture constructor

const OnGesture({
  1. Key? key,
  2. required GestureType type,
  3. required Widget child,
  4. HitTestBehavior? behavior,
  5. Set<PointerDeviceKind>? supportedDevices,
  6. required VoidCallback action,
})

Creates an OnGesture widget for the specified gesture type.

The type parameter specifies which gesture to detect. The child parameter is the widget that will receive the gesture. The action parameter is the function to call when the gesture is detected.

The behavior parameter can be used to specify how the widget behaves during hit testing. The supportedDevices parameter can limit which input devices can trigger the gesture.

Implementation

const OnGesture(
    {super.key,
    required this.type,
    required this.child,
    this.behavior,
    this.supportedDevices,
    required this.action});