snap method

Future snap()

Implementation

Future snap() async {
  checkViewAndBound();
  Offset snapTarget = getSnapTarget();
  if (animateSnap) {
    await move(snapTarget);
    deltaNotifier.value = snapTarget;
  } else
    deltaNotifier.value = snapTarget;

  delta = Offset.zero;
  beginDragPosition = null;
  updateDragPosition = null;
  overrideDelta = Offset.zero;

  if (onSnap != null) onSnap!(deltaNotifier.value);
}