driveSnapshotRevert method
Interactive counterpart of restoreSnapshotAnimated: blends the RENDER transform between the last saveSnapshot (t = 0) and the in-session state (t = 1). The crop screen maps its swipe-back progress here so the image visibly un-zooms with the finger. t back at 1 releases the drive (aborted swipe). Data state is untouched — a completed swipe pops the screen, whose restore path commits the snapshot and animates the remainder.
flipX is excluded from the blend (interpolating it through zero squashes the image); a session flip reverses via the card-flip in the post-pop restore instead.
Implementation
void driveSnapshotRevert(double t) {
final s = _snapshot;
if (s == null) return;
if (t >= 1) {
if (_revertSession == null) return;
_revertSession = null;
final flipX = _renderTransform.flipX;
_renderTransform.update(imageTransform);
_renderTransform.flipX = flipX;
_showBackdrop(animated: false);
notifyListeners();
return;
}
_settleAnimator.cancel();
_renderAnimator.cancel();
if (_revertSession == null) _hideBackdrop(animated: false);
final session = _revertSession ??= imageTransform.clone();
final flipX = _renderTransform.flipX;
_renderTransform.update(
s.imageTransform +
(session - s.imageTransform) * t.clamp(0.0, 1.0).toDouble(),
);
_renderTransform.flipX = flipX;
notifyListeners();
}