TextSelectionGestureDetector class

A gesture detector to respond to non-exclusive event chains for a text field.

An ordinary GestureDetector configured to handle events like tap and double tap will only recognize one or the other. This widget detects both: the first tap and then any subsequent taps that occurs within a time limit after the first.

See also:

  • TextField, a Material text field which uses this gesture detector.
  • CupertinoTextField, a Cupertino text field which uses this gesture detector.
Inheritance

Constructors

TextSelectionGestureDetector({Key? key, VoidCallback? onTapTrackStart, VoidCallback? onTapTrackReset, GestureTapDragDownCallback? onTapDown, GestureForcePressStartCallback? onForcePressStart, GestureForcePressEndCallback? onForcePressEnd, GestureTapCallback? onSecondaryTap, GestureTapDownCallback? onSecondaryTapDown, GestureTapDragUpCallback? onSingleTapUp, GestureCancelCallback? onSingleTapCancel, GestureTapCallback? onUserTap, GestureLongPressStartCallback? onSingleLongTapStart, GestureLongPressMoveUpdateCallback? onSingleLongTapMoveUpdate, GestureLongPressEndCallback? onSingleLongTapEnd, GestureTapDragDownCallback? onDoubleTapDown, GestureTapDragDownCallback? onTripleTapDown, GestureTapDragStartCallback? onDragSelectionStart, GestureTapDragUpdateCallback? onDragSelectionUpdate, GestureTapDragEndCallback? onDragSelectionEnd, bool onUserTapAlwaysCalled = false, HitTestBehavior? behavior, required Widget child})
Create a TextSelectionGestureDetector.
const

Properties

behavior HitTestBehavior?
How this gesture detector should behave during hit testing.
final
child Widget
Child below this widget.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onDoubleTapDown GestureTapDragDownCallback?
Called after a momentary hold or a short tap that is close in space and time (within kDoubleTapTimeout) to a previous short tap.
final
onDragSelectionEnd GestureTapDragEndCallback?
Called when a mouse that was previously dragging is released.
final
onDragSelectionStart GestureTapDragStartCallback?
Called when a mouse starts dragging to select text.
final
onDragSelectionUpdate GestureTapDragUpdateCallback?
Called repeatedly as a mouse moves while dragging.
final
onForcePressEnd GestureForcePressEndCallback?
Called when a pointer that had previously triggered onForcePressStart is lifted off the screen.
final
onForcePressStart GestureForcePressStartCallback?
Called when a pointer has tapped down and the force of the pointer has just become greater than ForcePressGestureRecognizer.startPressure.
final
onSecondaryTap GestureTapCallback?
Called for a tap event with the secondary mouse button.
final
onSecondaryTapDown GestureTapDownCallback?
Called for a tap down event with the secondary mouse button.
final
onSingleLongTapEnd GestureLongPressEndCallback?
Called after onSingleLongTapStart when the pointer is lifted.
final
onSingleLongTapMoveUpdate GestureLongPressMoveUpdateCallback?
Called after onSingleLongTapStart when the pointer is dragged.
final
onSingleLongTapStart GestureLongPressStartCallback?
Called for a single long tap that's sustained for longer than kLongPressTimeout but not necessarily lifted. Not called for a double-tap-hold, which calls onDoubleTapDown instead.
final
onSingleTapCancel GestureCancelCallback?
Called for each touch that becomes recognized as a gesture that is not a short tap, such as a long tap or drag. It is called at the moment when another gesture from the touch is recognized.
final
onSingleTapUp GestureTapDragUpCallback?
Called for the first tap in a series of taps, consecutive taps do not call this method.
final
onTapDown GestureTapDragDownCallback?
Called for every tap down including every tap down that's part of a double click or a long press, except touches that include enough movement to not qualify as taps (e.g. pans and flings).
final
onTapTrackReset VoidCallback?
Callback used to indicate that a tap tracking has been reset which happens on the next PointerDownEvent after the timer between two taps elapses, the recognizer loses the arena, the gesture is cancelled or the recognizer is disposed of.
final
onTapTrackStart VoidCallback?
Callback used to indicate that a tap tracking has started upon a PointerDownEvent.
final
onTripleTapDown GestureTapDragDownCallback?
Called after a momentary hold or a short tap that is close in space and time (within kDoubleTapTimeout) to a previous double-tap.
final
onUserTap GestureTapCallback?
Called for the first tap in a series of taps when onUserTapAlwaysCalled is disabled, which is the default behavior.
final
onUserTapAlwaysCalled bool
Whether onUserTap will be called for all taps including consecutive taps.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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