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.
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.
- flutter_swipe_button
A Flutter widget providing a swipe-to-action button to prevent accidental clicks.
50Compare
Works with
Packages commonly used together with pointer_interceptor: ones it builds on, ones built on it, and its own family.
- devtools_app_sharedBuilt on pointer_interceptorShared UI widgets, utilities and VM‑service helpers for Flutter DevTools extensions.
- storybook_flutterBuilt on pointer_interceptorA storybook for Flutter widgets to showcase and preview isolated components.
- html_editor_enhancedBuilt on pointer_interceptorHTML rich text editor for Android, iOS, and Web using the Summernote library
- drop_down_search_fieldBuilt on pointer_interceptorCustomizable dropdown with autocomplete, multi-select, and nested hierarchy
- webviewx_plusBuilt on pointer_interceptorCross‑platform webview widget using webview_flutter for mobile and iframe for web with JS interop
- storybook_toolkitBuilt on pointer_interceptorFlutter widget showcase and isolated preview tool
- kakao_map_pluginBuilt on pointer_interceptorFlutter plugin to use Kakao Map JavaScript API on Android, iOS, and Web via WebView and iframe.
- map_location_pickerBuilt on pointer_interceptorGoogle Maps location picker for Flutter with Places API search and typed addresses.