The transparent_pointer package provides a widget called TransparentPointer that allows developers to control hit testing in Flutter applications. By wrapping widgets with this component, you can make them transparent to pointer events, enabling underlying widgets to receive touch or mouse input instead. This is particularly useful during testing or when building complex UIs where precise event handling is required. The package supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux.
Use cases
- Testing UI interactions
- Bypassing hit testing for overlays
- Creating layered UI components
- Debugging gesture conflicts
- Implementing transparent touch zones
- Simulating user input in tests
Key features
- Controls hit testing behavior
- Supports all Flutter platforms
- Simple widget wrapper
- Ideal for test scenarios
- Enables event delegation
- Lightweight and minimal
Suitable for
- Test automation engineers
- UI developers needing fine-grained control
- Flutter app testers
- Developers building interactive overlays
- Those debugging gesture issues
- Prototyping complex gesture flows
Considerations
- Not intended for production UIs
- May interfere with normal touch behavior
- Requires careful integration in complex layouts
- Limited to hit testing manipulation
- Best used in development or testing environments
- Does not affect visual rendering