Gesture composition & interactions
Gesture Handler simplifies gesture interactions through dedicated composition hooks and relation properties. To choose the right approach, simply ask: are all the gestures attached to the same component?
- If yes — use composition hooks. These allow you to bundle multiple gestures — including previously composed ones — into a single object for a
GestureDetector. - If no — use relation properties to manually define how gestures interact. Since these properties also support composed gestures, you can mix both methods for more complex layouts.
Composition hooks
useCompetingGestures— only one of the provided gestures can become active at the same time. The first gesture to activate cancels the rest.useSimultaneousGestures— all of the provided gestures can activate at the same time. Activation of one does not cancel the others.useExclusiveGestures— only one of the provided gestures can become active, with priority determined by the order of the arguments. A gesture activates only after all higher-priority gestures have failed.
Cross-component interactions
simultaneousWith— allows gestures attached to different components to be recognized simultaneously.requireToFail— delays activation of a gesture until all gestures passed as arguments fail (or don't begin at all).block— works likerequireToFailwith the direction of the relation reversed. Especially useful for lists, where aScrollViewneeds to wait for every gesture underneath it.