loop method

TickerFuture loop({
  1. Duration? duration,
})

Starts playing the animation in an endless loop. After reaching the end, it starts over from the beginning.

If a duration named parameter is provided it will be applied as the AnimationController.duration value. The duration applies to the length of one loop iteration.

Returns a TickerFuture that only completes when the animation gets canceled.

Example: (using supercharged)

controller.loop(5.seconds);

Implementation

TickerFuture loop({Duration? duration}) {
  this.duration = duration ?? this.duration;
  return repeat();
}