XOnGestureWidget extension

Extension methods for easily adding gesture detection to any widget in Arcane UI.

These methods extend Widget with fluent APIs for OnGesture and OnHover, simplifying interactivity in Arcane components like IconButton, Tile, and CardSection. They promote concise code while ensuring performance through efficient GestureDetector wrapping, no rebuilds, and integration with ArcaneTheme for feedback, InkWell for ripples, and HapticFeedback for haptics. Use for enhanced UX in navigation (BottomNavigationBar) or forms, with Semantics support for accessibility.

Key features:

  • Fluent chaining for readable gesture addition.
  • Device-agnostic with optional filtering.
  • Optimized hit testing for dense UIs.

See also:

  • doc/component/gesture.md for more detailed documentation.
  • OnGesture, used internally for gesture wrapping.
  • OnHover, used for hover detection.
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 to this widget in Arcane UI.
onHover(void action(bool hovering)) Widget

Available on Widget, provided by the XOnGestureWidget extension

Adds a handler for hover events to this widget in Arcane UI.
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 to this widget in Arcane UI.
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 to this widget in Arcane UI.
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 to this widget in Arcane UI.
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 to this widget in Arcane UI.
onSecondaryPressed(VoidCallback action, {HitTestBehavior? behavior, Set<PointerDeviceKind>? supportedDevices}) Widget

Available on Widget, provided by the XOnGestureWidget extension

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

Available on Widget, provided by the XOnGestureWidget extension

Adds a handler for tertiary press gestures (middle-click) to this widget in Arcane UI.