repeat method

Cmd repeat({
  1. double? min,
  2. double? max,
  3. bool reverse = false,
  4. Duration? period,
  5. Curve curve = Curves.linear,
})

Repeats the animation indefinitely between min and max.

If reverse is true, alternates direction each cycle (ping-pong). Otherwise the value jumps back to min at the end of each cycle.

Returns a Cmd that schedules the first animation frame tick.

Implementation

Cmd repeat({
  double? min,
  double? max,
  bool reverse = false,
  Duration? period,
  Curve curve = Curves.linear,
}) {
  final lo = min ?? lowerBound;
  final hi = max ?? upperBound;
  if (period != null) duration = period;
  _value = lo;
  _startValue = lo;
  _targetValue = hi;
  _curve = curve;
  _status = AnimationStatus.forward;
  _startTime = null;
  _repeating = true;
  _reverseOnRepeat = reverse;
  _notifyStatusListeners();
  return _scheduleTick();
}