Overview
The pointer_interceptor package provides a widget that ensures pointer events (like clicks) are not absorbed by underlying HtmlElementViews on the web. It allows Flutter widgets to receive input events even when positioned over web-specific components such as iframes or embedded HTML content. This is particularly useful for maintaining interactive functionality in hybrid web applications where native HTML elements might otherwise intercept gestures. The package is designed for seamless integration with Flutter's web platform and supports iOS and web platforms.
Use cases
- Handling touch events over iframes
- Ensuring button interactions work over embedded web content
- Preventing gesture loss in web-based hybrid apps
- Improving usability of web overlays
- Enabling clickable UI elements above HTML views
Key features
- Prevents event swallowing by HtmlElementViews
- Simple widget wrapper for event interception
- Cross-platform support for web and iOS
- Minimal configuration required
- Maintains Flutter's gesture system integrity
Suitable for
- Developers building web apps with embedded HTML
- Teams using iframes in Flutter web projects
- Apps requiring precise pointer control on web
- UIs with layered interactive components
- Projects needing reliable gesture handling on web
Considerations
- Limited to web and iOS platforms
- May require careful layering of widgets
- Not needed for non-HTML overlay scenarios
- Performance impact negligible but present
- Best used when interacting with external web content
