LongPressGestureRecognizer class

Recognizes long-press gestures.

A long-press is a pointer-down held for duration without moving beyond kTouchSlop cells. On timer expiry the gesture is accepted and onLongPressStart / onLongPress fire. On pointer-up after acceptance, onLongPressEnd fires.

Inheritance

Properties

duration Duration
How long the pointer must be held before the long-press triggers.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
initialPosition Offset?
Position where the pointer first went down.
getter/setter pairinherited
onLongPress GestureLongPressCallback?
Callback fired when the long-press is first recognized.
getter/setter pair
onLongPressEnd GestureLongPressEndCallback?
Callback fired when the pointer is released after a long-press.
getter/setter pair
onLongPressStart GestureLongPressStartCallback?
Callback fired with position details when the long-press starts.
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

kTouchSlop → const double
Maximum distance in cells the pointer can move before cancelling.