wrapWithModalInteractionGuard method

Widget wrapWithModalInteractionGuard(
  1. Widget liveChild
)

Wraps liveChild in a Stack with a transparent opaque Listener on top while any modal is above the host route. The Listener actively CLAIMS pointer events via Flutter's gesture arena, which is the only reliable Dart-side way to keep a tap from being forwarded to the native iOS PlatformView's gesture recognizers.

Why this, and not AbsorbPointer: AbsorbPointer marks the subtree non-hit-testable, but Flutter's iOS hybrid-composition gesture-forwarder uses its own delaying recognizers to ferry touches to the native UIView's gestureRecognizers. That path runs even when AbsorbPointer wraps the platform view, so on-device the native UIButton's press animation still fires and (sometimes) the action runs too. A Listener overlay sits as a sibling on top of the platform view in the widget tree and HANDLES onPointerDown. Once handled, Flutter considers the arena won and stops forwarding the gesture to the platform view.

The native setInteractive channel call (which also fires from the mixin) remains a belt-and-suspenders safety on top of this overlay, in case future Flutter releases change platform-view dispatch.

TAPPING-FIX REVERT: this method is currently a passthrough so we can isolate the rebuild/blink issue. Each widget still calls it from build, but it does nothing extra. The previous Stack + IgnorePointer + Listener overlay (and its earlier AbsorbPointer variant) caused widget-tree-shape changes that triggered platform- view destroy/recreate on modal open/close. We'll reintroduce a gesture guard only after the blink source is identified.

Implementation

Widget wrapWithModalInteractionGuard(Widget liveChild) => liveChild;