pointerDragAnchorStrategy function

Offset pointerDragAnchorStrategy(
  1. Draggable<Object> draggable,
  2. BuildContext context,
  3. 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.)

See also:

Implementation

Offset pointerDragAnchorStrategy(Draggable<Object> draggable, BuildContext context, Offset position) {
  return Offset.zero;
}