Draggable<T extends Object> constructor
- Key? key,
- required Widget child,
- required Widget feedback,
- T? data,
- Axis? axis,
- Widget? childWhenDragging,
- Offset feedbackOffset = Offset.zero,
- DragAnchorStrategy dragAnchorStrategy = childDragAnchorStrategy,
- Axis? affinity,
- int? maxSimultaneousDrags,
- VoidCallback? onDragStarted,
- DragUpdateCallback? onDragUpdate,
- DraggableCanceledCallback? onDraggableCanceled,
- DragEndCallback? onDragEnd,
- VoidCallback? onDragCompleted,
- bool ignoringFeedbackSemantics = true,
- bool ignoringFeedbackPointer = true,
- bool rootOverlay = false,
- HitTestBehavior hitTestBehavior = HitTestBehavior.deferToChild,
- 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);