HitTestable, which implies the presence of a
hitTestmethod. The default implementation defers to
RenderView, which itself implements
hitTestto visit the entire render tree. Each render object is given an opportunity to add itself to a shared
HitTestDispatcher) uses the
PointerRouterto pass the original event to all render objects that were hit (
HitTestTarget, and therefore provides
handleEvent). If a
GestureRecognizeris utilized, the event’s pointer is passed via
GestureRecognizer.addPointerwhich registers with the
PointerRouterto receive future events.
HitTestTargetas well as any routes registered with the
PointerDownEventwill close the gesture area, barring additional entries, whereas
PointerUpEventwill sweep it, resolving competing gestures and preventing indecisive gestures from locking up input.
Window.onPointerDataPacketcaptures pointer updates from the engine and generates
PointerEventsfrom the raw data.
PointerEventConverteris utilized to map physical coordinates from the engine to logical coordinates, taking into account the device’s pixel ratio (via
PointerDownEvent. Gesture recognizers determine whether a pointer is allowed by overriding
GestureRecognizer.isPointerAllowed. If so, the recognizer subscribes to future pointer events via the
PointerRouterand adds the pointer to the gesture arena via
rejectGesture), spontaneous decisions about the gesture (
GestureArenaEntry.resolve), and other externalities. Typically, recognizers watch the stream of
HitTestTarget.handleEvent, looking for terminating events like
PointerDown, or criteria that will cause acceptance / rejection. If the gesture is accepted, the recognizer will continue to process events to characterize the gesture, invoking user-provided callbacks at key moments.
GestureArenaTeamcombines multiple recognizers together into a group.
MultiTapGestureRecognizer) that simultaneously process multiple pointers (i.e., tapping with two fingers will register twice), and single-touch recognizer (i.e.,
OneSequenceGestureRecognizer) that will only consider events from a single pointer (i.e., tapping with two fingers will register once).
VelocityTrackerthat generates fairly accurate estimates about drag velocity using curve fitting.
PointerRouter. Local routes are used as described above; global routes are used to react to any interaction (i.e., to dismiss a tooltip).