reverse method

Cmd reverse({
  1. double? from,
  2. Curve curve = Curves.linear,
})

Starts animating backward (toward lowerBound).

Returns a Cmd that schedules the first animation frame tick.

When reverseDuration (or duration) is null or Duration.zero, the animation completes synchronously and processTick is not required.

Implementation

Cmd reverse({double? from, Curve curve = Curves.linear}) {
  if (from != null) _value = from.clamp(lowerBound, upperBound);
  _targetValue = lowerBound;
  _startValue = _value;
  _curve = curve;
  _status = AnimationStatus.reverse;
  _startTime = null;
  _repeating = false;
  _notifyStatusListeners();
  final activeDuration = _activeDuration;
  if (activeDuration == null || activeDuration == Duration.zero) {
    _value = _targetValue;
    _completeAnimation();
    return Cmd.none();
  }
  return _scheduleTick();
}