DoubleTapGestureRecognizer class

Recognizes double-tap gestures.

A double-tap is two taps within doubleTapTimeout and kDoubleTapSlop cells of each other. The first tap sets up the recognizer, and if a second tap occurs within the time and distance thresholds, onDoubleTap is invoked.

If the timeout expires before a second tap, the recognizer resets and waits for a new first tap.

Inheritance

Constructors

DoubleTapGestureRecognizer({GestureTimerFactory? timerFactory})

Properties

hashCode int
The hash code for this object.
no setterinherited
initialPosition Offset?
Position where the pointer first went down.
getter/setter pairinherited
onDoubleTap GestureTapCallback?
Callback fired when a double-tap is detected.
getter/setter pair
pendingCmds List<Cmd>
Commands accumulated from callbacks during the current event.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state GestureRecognizerState
Current lifecycle state.
getter/setter pairinherited

Methods

acceptGesture() → void
Called when this recognizer wins the arena.
override
addCmd(Cmd? cmd) → void
Adds a command to pendingCmds if non-null.
inherited
dispose() → void
Cleans up resources. Called when the recognizer is no longer needed.
override
handlePointerDown(MouseMsg event, Offset localPosition) → void
Called when a pointer-down event occurs.
override
handlePointerMove(MouseMsg event, Offset localPosition) → void
Called when a pointer-move event occurs.
override
handlePointerUp(MouseMsg event, Offset localPosition) → void
Called when a pointer-up event occurs.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rejectGesture() → void
Called when this recognizer loses the arena.
override
reset() → void
Resets the recognizer to GestureRecognizerState.ready.
override
resolve(GestureDisposition disposition) → void
Requests acceptance or rejection from the arena.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

doubleTapTimeout → const Duration
Maximum time between the two taps.
kDoubleTapSlop → const double
Maximum distance in cells between the two tap locations.