IndicatorController constructor

IndicatorController({
  1. required TickerProvider vsync,
  2. required Color color,
  3. required Duration duration,
  4. required Duration timeout,
  5. required double offset,
})

Implementation

IndicatorController({
  required this.vsync,
  required this.color,
  required this.duration,
  required this.timeout,
  required this.offset,
}) {
  _offsetTween = Tween(begin: 0, end: offset);
  _opacityTween = TweenSequence<double>([
    TweenSequenceItem(weight: 2.0, tween: Tween(begin: 0, end: 1)),
    TweenSequenceItem(weight: 1.0, tween: Tween(begin: 1, end: 1)),
    TweenSequenceItem(weight: 2.0, tween: Tween(begin: 1, end: 0)),
  ]);

  _controller = AnimationController(vsync: vsync, duration: duration);

  _opacityAnimation = _opacityTween.animate(
      CurvedAnimation(parent: _controller, curve: const Interval(0, 1.0)))
    ..addListener(_animationListener);

  _offsetAnimation = _offsetTween.animate(_controller)
    ..addListener(_animationListener)
    ..addStatusListener(_animationStatusListener);

  _controller.forward();
}