tweenBack method

void tweenBack({
  1. Function? onComplete,
  2. double ease(
    1. double
    )?,
  3. double? duration,
})

Implementation

void tweenBack({
  Function? onComplete,
  double Function(double)? ease,
  double? duration,
}) {
  final snapshot = _previousViewportState;
  if (snapshot == null) {
    return;
  }
  final currentScale = viewportScale;
  _viewport.tween(
    duration: duration ?? .2,
    scale: snapshot.scale,
    ease: ease ?? GEase.easeInOut,
    x: snapshot.x,
    y: snapshot.y,
    onComplete: onComplete,
  );
  _event.emit(
    'zoom',
    ZoomEventData(
      prevScale: currentScale,
      nextScale: _previousViewportState?.scale ?? currentScale,
    ),
  );
}