repeat method

AnimationSpec repeat(
  1. int count, {
  2. bool reverse = true,
})

Returns a copy of this AnimationSpec which repeats count times.

If reverse is true, the animation will reverse after finishing, instead of starting immediately from the beginning. A reverse counts as a repeat.

Examples

import 'package:flutter/animation.dart';

final withRepeat = Curves.linear.animation().repeat(2);

Implementation

AnimationSpec repeat(int count, {bool reverse = true}) {
  if (count < 0) {
    throw ArgumentError.value(count, 'count', 'must be greater than zero.');
  }
  return _copyWith(repeatCount: count, reverse: reverse);
}