childDragAnchorStrategy function Null safety
- Draggable<
Object> draggable, - BuildContext context,
- Offset position
Display the feedback anchored at the position of the original child.
If feedback is identical to the child, then this means the feedback will exactly overlap the original child when the drag starts.
This is the default DragAnchorStrategy and replaces DragAnchor.child.
See also:
- DragAnchorStrategy, the typedef that this function implements.
- Draggable.dragAnchorStrategy, for which this is a built-in value.
Implementation
Offset childDragAnchorStrategy(Draggable<Object> draggable, BuildContext context, Offset position) {
final RenderBox renderObject = context.findRenderObject()! as RenderBox;
return renderObject.globalToLocal(position);
}