Skip to content
pubscout

pointer_interceptor

0.10.1+3, released 2 months ago by flutter.dev

A widget to prevent clicks from being swallowed by underlying HtmlElementViews on the web.

WASM-ready
$ flutter pub add pointer_interceptor
Source repository

What it does

PointerInterceptor is a widget that prevents mouse events from being captured by an underlying HtmlElementView on the web, or an underlying PlatformView on iOS. It creates an empty platform view behind its child widget in paint order, allowing Flutter widgets to successfully handle pointer events.

AI-written summary of version 0.10.1+3, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to render Flutter widgets on top of background maps, video players, or iframes on the web.
  • Your FloatingActionButton or Drawer is unclickable because it overlaps an HTML element view.

Skip it when

  • You are building a mobile-only app without platform views or HtmlElementViews.
  • You are using multiple instances heavily on iOS where it can cause performance overhead and increase memory usage.

Strengths

  • Solves web click interception issues with HtmlElementViews seamlessly.
  • Includes a convenient `intercepting` property to toggle behavior conditionally.
  • Supports a `debug` property to visualize the intercepted area.

Weaknesses

  • Can be slow and increase memory usage if multiple instances are used on iOS.
  • Platform-specific overhead due to underlying platform views.

Setup

Kind
Plugin (native code)
Effort
Low
Code generation
No
Direct dependencies
3
PointerInterceptor(
  child: ElevatedButton(
    onPressed: () {},
    child: const Text('Click Me'),
  ),
)

Alternatives

Packages that do the same job and could replace pointer_interceptor.

Works with

Packages commonly used together with pointer_interceptor: ones it builds on, ones built on it, and its own family.