GesturePatternDetector constructor

const GesturePatternDetector({
  1. required GesturePattern pattern,
  2. required VoidCallback onPattern,
  3. required Widget child,
  4. Duration timeout = const Duration(seconds: 5),
  5. Key? key,
  6. HitTestBehavior? behavior,
  7. Set<PointerDeviceKind>? supportedDevices,
  8. bool excludeFromSemantics = false,
  9. bool trackpadScrollCausesScale = false,
  10. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  11. 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,
});