Draggable<T extends Object> constructor

const Draggable<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. DragAnchorStrategy dragAnchorStrategy = childDragAnchorStrategy,
  9. Axis? affinity,
  10. int? maxSimultaneousDrags,
  11. VoidCallback? onDragStarted,
  12. DragUpdateCallback? onDragUpdate,
  13. DraggableCanceledCallback? onDraggableCanceled,
  14. DragEndCallback? onDragEnd,
  15. VoidCallback? onDragCompleted,
  16. bool ignoringFeedbackSemantics = true,
  17. bool ignoringFeedbackPointer = true,
  18. bool rootOverlay = false,
  19. HitTestBehavior hitTestBehavior = HitTestBehavior.deferToChild,
  20. AllowedButtonsFilter? allowedButtonsFilter,
})

Creates a widget that can be dragged to a DragTarget.

If maxSimultaneousDrags is non-null, it must be non-negative.

Implementation

const Draggable({
  super.key,
  required this.child,
  required this.feedback,
  this.data,
  this.axis,
  this.childWhenDragging,
  this.feedbackOffset = Offset.zero,
  this.dragAnchorStrategy = childDragAnchorStrategy,
  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.allowedButtonsFilter,
}) : assert(maxSimultaneousDrags == null || maxSimultaneousDrags >= 0);