repeat method

TickerFuture repeat ({double min, double max, Duration period })

Starts running this animation in the forward direction, and restarts the animation when it completes.

Defaults to repeating between the lower and upper bounds.

Returns a TickerFuture that never completes. The TickerFuture.orCancel future completes with an error when the animation is stopped (e.g. with stop).

The most recently returned TickerFuture, if any, is marked as having been canceled, meaning the future never completes and its TickerFuture.orCancel derivative future completes with a TickerCanceled error.

Implementation

TickerFuture repeat({ double min, double max, Duration period }) {
  min ??= lowerBound;
  max ??= upperBound;
  period ??= duration;
  assert(() {
    if (period == null) {
      throw FlutterError(
        'AnimationController.repeat() called without an explicit period and with no default Duration.\n'
        'Either the "period" argument to the repeat() method should be provided, or the '
        '"duration" property should be set, either in the constructor or later, before '
        'calling the repeat() function.'
      );
    }
    return true;
  }());
  return animateWith(_RepeatingSimulation(min, max, period));
}