LongPressDraggable<T extends Object> constructor Null safety

const LongPressDraggable<T extends Object>(
  1. {Key? key,
  2. required Widget child,
  3. required Widget feedback,
  4. T? data,
  5. Axis? axis,
  6. Widget? childWhenDragging,
  7. Offset feedbackOffset = Offset.zero,
  8. @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.') DragAnchor dragAnchor = DragAnchor.child,
  9. DragAnchorStrategy? dragAnchorStrategy,
  10. int? maxSimultaneousDrags,
  11. VoidCallback? onDragStarted,
  12. DragUpdateCallback? onDragUpdate,
  13. DraggableCanceledCallback? onDraggableCanceled,
  14. DragEndCallback? onDragEnd,
  15. VoidCallback? onDragCompleted,
  16. bool hapticFeedbackOnStart = true,
  17. bool ignoringFeedbackSemantics = true,
  18. bool ignoringFeedbackPointer = true,
  19. 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 LongPressDraggable({
  super.key,
  required super.child,
  required super.feedback,
  super.data,
  super.axis,
  super.childWhenDragging,
  super.feedbackOffset,
  @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.',
  )
  super.dragAnchor,
  super.dragAnchorStrategy,
  super.maxSimultaneousDrags,
  super.onDragStarted,
  super.onDragUpdate,
  super.onDraggableCanceled,
  super.onDragEnd,
  super.onDragCompleted,
  this.hapticFeedbackOnStart = true,
  super.ignoringFeedbackSemantics,
  super.ignoringFeedbackPointer,
  this.delay = kLongPressTimeout,
});