GesturePatternDetector class

A widget that detects a Morse code-like gesture pattern.

This widget wraps another widget (child) and listens for user gestures. It recognizes a pattern of gestures, such as taps, long presses, and swipes, and triggers the onPattern callback when the specified pattern is successfully matched.

Inheritance

Constructors

GesturePatternDetector({required GesturePattern pattern, required VoidCallback onPattern, required Widget child, Duration timeout = const Duration(seconds: 5), Key? key, HitTestBehavior? behavior, Set<PointerDeviceKind>? supportedDevices, bool excludeFromSemantics = false, bool trackpadScrollCausesScale = false, DragStartBehavior dragStartBehavior = DragStartBehavior.start, Offset trackpadScrollToScaleFactor = kDefaultTrackpadScrollToScaleFactor})
Creates a GesturePatternDetector widget.
const

Properties

behavior → HitTestBehavior?
How this gesture detector should behave during hit testing when deciding how the hit test propagates to children and whether to consider targets behind this one.
final
child → Widget
The widget that will be wrapped with the gesture detector.
final
dragStartBehavior → DragStartBehavior
Determines the way that drag start behavior is handled.
final
excludeFromSemantics → bool
Whether to exclude these gestures from the semantics tree. For example, the long-press gesture for showing a tooltip is excluded because the tooltip itself is included in the semantics tree directly and so having a gesture to show it would result in duplication of information.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onPattern → VoidCallback
Callback invoked when the gesture pattern is successfully matched.
final
pattern → GesturePattern
The gesture pattern to detect.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
supportedDevices → Set<PointerDeviceKind>?
The kind of devices that are allowed to be recognized.
final
timeout → Duration
The duration within which the gesture pattern must be completed.
final
trackpadScrollCausesScale → bool
Whether scrolling up/down on a trackpad should cause scaling instead of panning.
final
trackpadScrollToScaleFactor → Offset
A factor to control the direction and magnitude of scale when converting trackpad scrolling.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<GesturePatternDetector>
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, int wrapWidth = 65}) → 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