LongPressDraggableModifier<T extends Object> constructor
const
LongPressDraggableModifier<T extends Object> ({
- Key? key,
- Widget? child,
- Key? modifierKey,
- required Widget feedback,
- T? data,
- Axis? axis,
- Widget? childWhenDragging,
- Offset 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.') dynamic dragAnchor = DragAnchor.child,
- DragAnchorStrategy? dragAnchorStrategy,
- 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,
- bool hapticFeedbackOnStart = false,
- 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,
});