LongPressDraggableModifier<T extends Object> constructor

const LongPressDraggableModifier<T extends Object>({
  1. Key? key,
  2. Widget? child,
  3. Key? modifierKey,
  4. required Widget feedback,
  5. T? data,
  6. Axis? axis,
  7. Widget? childWhenDragging,
  8. Offset feedbackOffset = Offset.zero,
  9. @Deprecated('Use dragAnchorStrategy instead. ' 'Replace "dragAnchor: DragAnchor.child" with "dragAnchorStrategy: childDragAnchorStrategy". ' 'Replace "dragAnchor: DragAnchor.pointer" with "dragAnchorStrategy: pointerDragAnchorStrategy". ' 'This feature was deprecated after v2.1.0-10.0.pre.') dynamic dragAnchor = DragAnchor.child,
  10. DragAnchorStrategy? dragAnchorStrategy,
  11. Axis? affinity,
  12. int? maxSimultaneousDrags,
  13. VoidCallback? onDragStarted,
  14. DragUpdateCallback? onDragUpdate,
  15. DraggableCanceledCallback? onDraggableCanceled,
  16. DragEndCallback? onDragEnd,
  17. VoidCallback? onDragCompleted,
  18. bool ignoringFeedbackSemantics = true,
  19. bool ignoringFeedbackPointer = true,
  20. bool rootOverlay = false,
  21. HitTestBehavior hitTestBehavior = HitTestBehavior.deferToChild,
  22. bool hapticFeedbackOnStart = false,
  23. Duration delay = kLongPressTimeout,
})

Creates a widget that can be dragged starting from long press.

The child and feedback arguments must not be null. If maxSimultaneousDrags is non-null, it must be non-negative.

Implementation

const LongPressDraggableModifier({
  super.key,
  super.child,
  super.modifierKey,
  required this.feedback,
  this.data,
  this.axis,
  this.childWhenDragging,
  this.feedbackOffset = Offset.zero,
  @Deprecated(
    'Use dragAnchorStrategy instead. '
    'Replace "dragAnchor: DragAnchor.child" with "dragAnchorStrategy: childDragAnchorStrategy". '
    'Replace "dragAnchor: DragAnchor.pointer" with "dragAnchorStrategy: pointerDragAnchorStrategy". '
    'This feature was deprecated after v2.1.0-10.0.pre.',
  )
      this.dragAnchor = DragAnchor.child,
  this.dragAnchorStrategy,
  this.affinity,
  this.maxSimultaneousDrags,
  this.onDragStarted,
  this.onDragUpdate,
  this.onDraggableCanceled,
  this.onDragEnd,
  this.onDragCompleted,
  this.ignoringFeedbackSemantics = true,
  this.ignoringFeedbackPointer = true,
  this.rootOverlay = false,
  this.hitTestBehavior = HitTestBehavior.deferToChild,
  this.hapticFeedbackOnStart = false,
  this.delay = kLongPressTimeout,
});