GesturePatternDetector constructor
const
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.
pattern
is the gesture pattern to be detected.
onPattern
is the callback to be invoked when the pattern is successfully matched.
child
is the widget to be wrapped and monitored for gestures.
timeout
is the duration within which the pattern must be completed before it resets.
The default timeout is 5 seconds.
Implementation
const GesturePatternDetector({
required this.pattern,
required this.onPattern,
required this.child,
this.timeout = const Duration(seconds: 5),
super.key,
// default
this.behavior,
this.supportedDevices,
this.excludeFromSemantics = false,
this.trackpadScrollCausesScale = false,
this.dragStartBehavior = DragStartBehavior.start,
this.trackpadScrollToScaleFactor = kDefaultTrackpadScrollToScaleFactor,
});