gestures library
The Flutter gesture recognizers.
To use, import package:flutter/gestures.dart
.
Classes
- DelayedMultiDragGestureRecognizer
- Recognizes movement both horizontally and vertically on a per-pointer basis after a delay. [...]
- DoubleTapGestureRecognizer
- Recognizes when the user has tapped the screen at the same location twice in quick succession.
- Drag
- Interface for objects that receive updates about drags. [...]
- DragDownDetails
- Details object for callbacks that use GestureDragDownCallback. [...]
- DragEndDetails
- Details object for callbacks that use GestureDragEndCallback. [...]
- DragGestureRecognizer
- Recognizes movement. [...]
- DragStartDetails
- Details object for callbacks that use GestureDragStartCallback. [...]
- DragUpdateDetails
- Details object for callbacks that use GestureDragUpdateCallback. [...]
- EagerGestureRecognizer
- A gesture recognizer that eagerly claims victory in all gesture arenas. [...]
- FlutterErrorDetailsForPointerEventDispatcher
- Variant of FlutterErrorDetails with extra fields for the gesture library's binding's pointer event dispatcher (GestureBinding.dispatchEvent). [...]
- FlutterErrorDetailsForPointerRouter
- Variant of FlutterErrorDetails with extra fields for the gestures library's pointer router (PointerRouter). [...]
- GestureArenaEntry
- An interface to information to an arena. [...]
- GestureArenaManager
- The first member to accept or the last member to not reject wins. [...]
- GestureArenaMember
- Represents an object participating in an arena. [...]
- GestureArenaTeam
- A group of GestureArenaMember objects that are competing as a unit in the GestureArenaManager. [...]
- GestureRecognizer
- The base class that all gesture recognizers inherit from. [...]
- HitTestable
- An object that can hit-test pointers.
- HitTestDispatcher
- An object that can dispatch events.
- HitTestEntry
- Data collected during a hit test about a specific HitTestTarget. [...]
- HitTestResult
- The result of performing a hit test.
- HitTestTarget
- An object that can handle events.
- HorizontalDragGestureRecognizer
- Recognizes movement in the horizontal direction. [...]
- HorizontalMultiDragGestureRecognizer
- Recognizes movement in the horizontal direction on a per-pointer basis. [...]
- ImmediateMultiDragGestureRecognizer
- Recognizes movement both horizontally and vertically on a per-pointer basis. [...]
- LeastSquaresSolver
- Uses the least-squares algorithm to fit a polynomial to a set of data.
- LongPressGestureRecognizer
- Recognizes when the user has pressed down at the same location for a long period of time.
-
MultiDragGestureRecognizer<
T extends MultiDragPointerState> - Recognizes movement on a per-pointer basis. [...]
- MultiDragPointerState
- Per-pointer state for a MultiDragGestureRecognizer. [...]
- MultiTapGestureRecognizer
- Recognizes taps on a per-pointer basis. [...]
- Offset
- An immutable 2D floating-point offset. [...]
- OneSequenceGestureRecognizer
- Base class for gesture recognizers that can only recognize one gesture at a time. For example, a single TapGestureRecognizer can never recognize two taps happening simultaneously, even if multiple pointers are placed on the same widget. [...]
- PanGestureRecognizer
- Recognizes movement both horizontally and vertically. [...]
- PointerAddedEvent
- The device has started tracking the pointer. [...]
- PointerCancelEvent
- The input from the pointer is no longer directed towards this receiver.
- PointerDownEvent
- The pointer has made contact with the device.
- PointerEvent
- Base class for touch, stylus, or mouse events. [...]
- PointerEventConverter
- Converts from engine pointer data to framework pointer events. [...]
- PointerHoverEvent
- The pointer has moved with respect to the device while the pointer is not in contact with the device. [...]
- PointerMoveEvent
- The pointer has moved with respect to the device while the pointer is in contact with the device. [...]
- PointerRemovedEvent
- The device is no longer tracking the pointer. [...]
- PointerRouter
- A routing table for PointerEvent events.
- PointerUpEvent
- The pointer has stopped making contact with the device.
- PolynomialFit
- An nth degree polynomial fit to a dataset.
- PrimaryPointerGestureRecognizer
- A base class for gesture recognizers that track a single primary pointer. [...]
- ScaleEndDetails
- Details for GestureScaleEndCallback.
- ScaleGestureRecognizer
- Recognizes a scale gesture. [...]
- ScaleStartDetails
- Details for GestureScaleStartCallback.
- ScaleUpdateDetails
- Details for GestureScaleUpdateCallback.
- TapDownDetails
- Details for GestureTapDownCallback, such as position. [...]
- TapGestureRecognizer
- Recognizes taps. [...]
- TapUpDetails
- Details for GestureTapUpCallback, such as position. [...]
- Velocity
- A velocity in two dimensions.
- VelocityEstimate
- A two dimensional velocity estimate. [...]
- VelocityTracker
- Computes a pointer's velocity based on data from PointerMoveEvents. [...]
- VerticalDragGestureRecognizer
- Recognizes movement in the vertical direction. [...]
- VerticalMultiDragGestureRecognizer
- Recognizes movement in the vertical direction on a per-pointer basis. [...]
Mixins
- GestureBinding
- A binding for the gesture subsystem. [...]
Constants
- kBackMouseButton → const int
-
The bit of PointerEvent.buttons that corresponds to the back mouse button. [...]
0x08
- kDoubleTapMinTime → const Duration
-
The minimum time from the end of the first tap to the start of the second
tap in a double-tap gesture. (Currently not honored by the
DoubleTapGestureRecognizer.)
const Duration(milliseconds: 40)
- kDoubleTapSlop → const double
-
Distance between the initial position of the first touch and the start
position of a potential second touch for the second touch to be considered
the second touch of a double-tap gesture.
100.0
- kDoubleTapTimeout → const Duration
-
The maximum time from the start of the first tap to the start of the second
tap in a double-tap gesture.
const Duration(milliseconds: 300)
- kDoubleTapTouchSlop → const double
-
The maximum distance that the first touch in a double-tap gesture can travel
before deciding that it is not part of a double-tap gesture.
DoubleTapGestureRecognizer also restricts the second touch to this distance.
kTouchSlop
- kForwardMouseButton → const int
-
The bit of PointerEvent.buttons that corresponds to the forward mouse button. [...]
0x10
- kHoverTapSlop → const double
-
Maximum distance between the down and up pointers for a tap. (Currently not
honored by the TapGestureRecognizer; PrimaryPointerGestureRecognizer,
which TapGestureRecognizer inherits from, uses kTouchSlop.)
20.0
- kHoverTapTimeout → const Duration
-
Maximum length of time between a tap down and a tap up for the gesture to be
considered a tap. (Currently not honored by the TapGestureRecognizer.)
const Duration(milliseconds: 150)
- kJumpTapTimeout → const Duration
-
The maximum time from the start of the first tap to the start of the second
tap in a jump-tap gesture.
const Duration(milliseconds: 500)
- kLongPressTimeout → const Duration
-
The time before a long press gesture attempts to win.
const Duration(milliseconds: 500)
- kMaxFlingVelocity → const double
-
Drag gesture fling velocities are clipped to this value.
8000.0
- kMiddleMouseButton → const int
-
The bit of PointerEvent.buttons that corresponds to the middle mouse button. [...]
0x04
- kMinFlingVelocity → const double
-
The minimum velocity for a touch to consider that touch to trigger a fling
gesture.
50.0
- kPagingTouchSlop → const double
-
The distance a touch has to travel for the framework to be confident that
the gesture is a paging gesture. (Currently not used, because paging uses a
regular drag gesture, which uses kTouchSlop.)
kTouchSlop * 2.0
- kPanSlop → const double
-
The distance a touch has to travel for the framework to be confident that
the gesture is a panning gesture.
kTouchSlop * 2.0
- kPressTimeout → const Duration
-
The time that must elapse before a tap gesture sends onTapDown, if there's
any doubt that the gesture is a tap.
const Duration(milliseconds: 100)
- kPrimaryMouseButton → const int
-
The bit of PointerEvent.buttons that corresponds to the primary mouse button. [...]
0x01
- kPrimaryStylusButton → const int
-
The bit of PointerEvent.buttons that corresponds to the primary stylus button. [...]
0x02
- kScaleSlop → const double
-
The distance a touch has to travel for the framework to be confident that
the gesture is a scale gesture.
kTouchSlop
- kSecondaryMouseButton → const int
-
The bit of PointerEvent.buttons that corresponds to the secondary mouse button. [...]
0x02
- kSecondaryStylusButton → const int
-
The bit of PointerEvent.buttons that corresponds to the secondary stylus button. [...]
0x04
- kTouchSlop → const double
-
The distance a touch has to travel for the framework to be confident that
the gesture is a scroll gesture, or, inversely, the maximum distance that a
touch can travel before the framework becomes confident that it is not a
tap.
18.0
- kWindowTouchSlop → const double
-
The margin around a dialog, popup menu, or other window-like widget inside
which we do not consider a tap to dismiss the widget. (Not currently used.)
16.0
- kZoomControlsTimeout → const Duration
-
The time for which zoom controls (e.g. in a map interface) are to be
displayed on the screen, from the moment they were last requested.
const Duration(milliseconds: 3000)
Properties
- debugPrintGestureArenaDiagnostics ↔ bool
-
Prints information about gesture recognizers and gesture arenas. [...]
read / write
- debugPrintHitTestResults ↔ bool
-
Whether to print the results of each hit test to the console. [...]
read / write
- debugPrintRecognizerCallbacksTrace ↔ bool
-
Logs a message every time a gesture recognizer callback is invoked. [...]
read / write
Functions
-
debugAssertAllGesturesVarsUnset(
String reason) → bool - Returns true if none of the gestures library debug variables have been changed. [...]
-
nthMouseButton(
int number) → int - The bit of PointerEvent.buttons that corresponds to the nth mouse button. [...]
-
nthStylusButton(
int number) → int - The bit of PointerEvent.buttons that corresponds to the nth stylus button. [...]
Enums
- GestureDisposition
- Whether the gesture was accepted or rejected.
- GestureRecognizerState
- The possible states of a PrimaryPointerGestureRecognizer. [...]
- PointerDeviceKind
- The kind of pointer device.
Typedefs
-
GestureDoubleTapCallback(
) → void - Signature for callback when the user has tapped the screen at the same location twice in quick succession.
-
GestureDragCancelCallback(
) → void - Signature for when the pointer that previously triggered a GestureDragDownCallback did not complete. [...]
-
GestureDragDownCallback(
DragDownDetails details) → void - Signature for when a pointer has contacted the screen and might begin to move. [...]
-
GestureDragEndCallback(
DragEndDetails details) → void - Signature for when a pointer that was previously in contact with the screen and moving is no longer in contact with the screen. [...]
-
GestureDragStartCallback(
DragStartDetails details) → void - Signature for when a pointer has contacted the screen and has begun to move. [...]
-
GestureDragUpdateCallback(
DragUpdateDetails details) → void - Signature for when a pointer that is in contact with the screen and moving has moved again. [...]
-
GestureLongPressCallback(
) → void - Signature for when a pointer has remained in contact with the screen at the same location for a long period of time.
-
GestureLongPressUpCallback(
) → void - Signature for when a pointer stops contacting the screen after a long press gesture was detected.
-
GestureMultiDragStartCallback(
Offset position) → Drag - Signature for when MultiDragGestureRecognizer recognizes the start of a drag gesture.
-
GestureMultiTapCallback(
int pointer) → void - Signature used by MultiTapGestureRecognizer for when a tap has occurred.
-
GestureMultiTapCancelCallback(
int pointer) → void - Signature for when the pointer that previously triggered a GestureMultiTapDownCallback will not end up causing a tap.
-
GestureMultiTapDownCallback(
int pointer, TapDownDetails details) → void - Signature used by MultiTapGestureRecognizer for when a pointer that might cause a tap has contacted the screen at a particular location.
-
GestureMultiTapUpCallback(
int pointer, TapUpDetails details) → void - Signature used by MultiTapGestureRecognizer for when a pointer that will trigger a tap has stopped contacting the screen at a particular location.
-
GestureScaleEndCallback(
ScaleEndDetails details) → void - Signature for when the pointers are no longer in contact with the screen.
-
GestureScaleStartCallback(
ScaleStartDetails details) → void - Signature for when the pointers in contact with the screen have established a focal point and initial scale of 1.0.
-
GestureScaleUpdateCallback(
ScaleUpdateDetails details) → void - Signature for when the pointers in contact with the screen have indicated a new focal point and/or scale.
-
GestureTapCallback(
) → void - Signature for when a tap has occurred. [...]
-
GestureTapCancelCallback(
) → void - Signature for when the pointer that previously triggered a GestureTapDownCallback will not end up causing a tap. [...]
-
GestureTapDownCallback(
TapDownDetails details) → void - Signature for when a pointer that might cause a tap has contacted the screen. [...]
-
GestureTapUpCallback(
TapUpDetails details) → void - Signature for when a pointer that will trigger a tap has stopped contacting the screen. [...]
-
PointerRoute(
PointerEvent event) → void - A callback that receives a PointerEvent
-
RecognizerCallback<
T>( ) → T - Generic signature for callbacks passed to GestureRecognizer.invokeCallback. This allows the GestureRecognizer.invokeCallback mechanism to be generically used with anonymous functions that return objects of particular types.