CurvedAnimationController<T>.sequence constructor

CurvedAnimationController<T>.sequence(
  1. List<SequenceItem> sequence,
  2. Duration? duration, {
  3. Curve curve = Curves.linear,
  4. Curve? reverseCurve = Curves.linear,
  5. Duration? reverseDuration,
  6. String? debugLabel,
  7. AnimationBehavior animationBehavior = AnimationBehavior.normal,
  8. required TickerProvider vsync,
})

Implementation

CurvedAnimationController.sequence(
  List<SequenceItem> sequence,
  this.duration, {
  this.curve = Curves.linear,
  this.reverseCurve = Curves.linear,
  this.reverseDuration,
  this.debugLabel,
  this.animationBehavior = AnimationBehavior.normal,
  required this.vsync,
}) {
  _tweenSequence = TweenSequence(sequence
      .map((item) => TweenSequenceItem(
            tween: Tween(begin: item.begin, end: item.end),
            weight: item.weight,
          ))
      .toList());

  _controller = AnimationController(
    vsync: vsync,
    animationBehavior: animationBehavior,
    debugLabel: debugLabel,
    reverseDuration: reverseDuration,
    duration: duration,
  );

  _animation = _tweenSequence!.animate(CurvedAnimation(
    parent: _controller,
    curve: curve,
    reverseCurve: reverseCurve,
  ));
}