mirror method

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

Starts playing the animation in an endless loop. After reaching the end, it plays it backwards, then forward and so on.

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

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

Implementation

TickerFuture mirror({Duration? duration}) {
  this.duration = duration ?? this.duration;
  return repeat(reverse: true);
}