resetAnimation method

  1. @override
void resetAnimation({
  1. Tween<T>? tween,
  2. Map<String, Tween<Object?>>? tweenMap,
  3. Duration? duration,
  4. Curve? curve,
  5. int? repeats,
  6. int? cycles,
})
override

The state of Animator widget.

From the parameter defined in the Animator widget, it instantiates the animation.

Implementation

@override
void resetAnimation({
  Tween<T>? tween,
  Map<String, Tween>? tweenMap,
  Duration? duration,
  Curve? curve,
  int? repeats,
  int? cycles,
}) {
  if (tween != null) {
    _animation = null;
    _tween = tween;
  }
  if (tweenMap != null) {
    _animationMap.clear();
    _tweenMap = tweenMap;
  }
  if (curve != null) {
    _animation = null;
  }
  injected.resetAnimation(
    duration: duration,
    curve: curve,
    repeats: repeats ?? cycles,
    shouldReverseRepeats: repeats != null
        ? false
        : cycles != null
            ? true
            : null,
  );
}