XOnGestureWidget extension

Extension methods for easily adding gesture detection to any widget.

These methods provide a more fluent API for adding gesture handlers to widgets, making the code more readable and concise.

See also:

  • doc/component/gesture.md for more detailed documentation
  • OnGesture, which these methods use internally
  • OnHover, which is used by the onHover method
on

Methods

onDoublePressed(VoidCallback action, {HitTestBehavior? behavior, Set<PointerDeviceKind>? supportedDevices}) Widget

Available on Widget, provided by the XOnGestureWidget extension

Adds a handler for double press/tap gestures.
onHover(void action(bool hovering)) Widget

Available on Widget, provided by the XOnGestureWidget extension

Adds a handler for hover events.
onLongPressed(VoidCallback action, {HitTestBehavior? behavior, Set<PointerDeviceKind>? supportedDevices}) Widget

Available on Widget, provided by the XOnGestureWidget extension

Adds a handler for long press gestures with the primary button.
onLongSecondaryPressed(VoidCallback action, {HitTestBehavior? behavior, Set<PointerDeviceKind>? supportedDevices}) Widget

Available on Widget, provided by the XOnGestureWidget extension

Adds a handler for long press gestures with the secondary button.
onLongTertiaryPressed(VoidCallback action, {HitTestBehavior? behavior, Set<PointerDeviceKind>? supportedDevices}) Widget

Available on Widget, provided by the XOnGestureWidget extension

Adds a handler for long press gestures with the tertiary button.
onPressed(VoidCallback action, {HitTestBehavior? behavior, Set<PointerDeviceKind>? supportedDevices}) Widget

Available on Widget, provided by the XOnGestureWidget extension

Adds a handler for primary press/tap gestures (equivalent to onTap).
onSecondaryPressed(VoidCallback action, {HitTestBehavior? behavior, Set<PointerDeviceKind>? supportedDevices}) Widget

Available on Widget, provided by the XOnGestureWidget extension

Adds a handler for secondary press gestures (equivalent to right-click).
onTertiaryPressed(VoidCallback action, {HitTestBehavior? behavior, Set<PointerDeviceKind>? supportedDevices}) Widget

Available on Widget, provided by the XOnGestureWidget extension

Adds a handler for tertiary press gestures (equivalent to middle-click).