IndicatorController constructor
IndicatorController({
- required TickerProvider vsync,
- required Color color,
- required Duration duration,
- required Duration timeout,
- 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();
}