Understanding Flutter's handling of Gestures
summary
Shows how Flutter routes pointer events through GestureBinding and hit testing, then builds a V-shaped GestureRecognizer using RawGestureDetector that tracks pointer down/move/up and successfully recognizes only V strokes in the demo. Explains hitTestBehavior differences (opaque / translucent / deferToChild) and why overlapping handlers lose taps to the Gesture Arena, then fixes it by using a low-level Listener to receive all pointer callbacks so both overlay and underlying button fire. Tests run with WidgetTester simulating pointer sequences.
AI-written summary · about
chapters (10)
- 0:00Introduction to gestures
- 1:07Classic gesture handling
- 2:31Custom gesture recognizers
- 8:35Building a V gesture detector
- 12:12Overlapping gesture handlers
- 13:39Hit test behavior explained
- 19:40Gesture arena and disambiguation
- 21:05Listener vs gesture detector
- 23:11Testing gestures in Flutter
- 26:01Summary and resources
related talks
13mLearn how Flutter enhances web apps
19mEnhancing my app for foldables
39mUnderstand touch event mechanics and master gestures
32mHow Flutter Stays Ahead of iOS Releases
41mPortable Material: Flutter physical models
25mCreating responsive UIs and other nuances of Flutter Web
22mInnovation and Trends in Flutter for web
20mBuilding RTL-Ready Flutter Apps
