appliedDragOffset property

Offset get appliedDragOffset

The displacement to apply to the container this frame: the raw offset plus the armed "lean toward home" cue, all faded by progress so it vanishes exactly at the handoff latch - the swap back to the home widget happens at zero offset.

Implementation

Offset get appliedDragOffset {
  final Offset offset = _drag.offset;
  if (offset == .zero) {
    return Offset.zero;
  }
  Offset total = offset;
  final double arm = morphDragArm(offset.distance);
  if (arm > 0) {
    // Armed, the card starts drifting toward its source: the
    // destination of a release becomes legible before the release.
    final Offset toHome =
        sourceRect.center - (lastTargetRect.center + offset);
    final double distance = toHome.distance;
    if (distance >= 1) {
      total += toHome / distance * (12 * arm);
    }
  }
  return total * controller.progress;
}