pointerDragAnchorStrategy function Null safety
- Draggable<
Object> draggable, - BuildContext context,
- Offset position
Display the feedback anchored at the position of the touch that started the drag.
If feedback is identical to the child, then this means the top left of the feedback will be under the finger when the drag starts. This will likely not exactly overlap the original child, e.g. if the child is big and the touch was not centered. This mode is useful when the feedback is transformed so as to move the feedback to the left by half its width, and up by half its width plus the height of the finger, since then it appears as if putting the finger down makes the touch feedback appear above the finger. (It feels weird for it to appear offset from the original child if it's anchored to the child and not the finger.)
This replaces DragAnchor.pointer, which has been deprecated.
See also:
- DragAnchorStrategy, the typedef that this function implements.
- Draggable.dragAnchorStrategy, for which this is a built-in value.
Implementation
Offset pointerDragAnchorStrategy(Draggable<Object> draggable, BuildContext context, Offset position) {
return Offset.zero;
}