CreatureCounter constructor

CreatureCounter({
  1. required TickerProvider vsync,
  2. required List<Color> initialColors,
  3. required int initialCounter,
  4. BlendMode blend = BlendMode.hardLight,
})

Implementation

CreatureCounter(
    {required TickerProvider vsync,
    required List<Color> initialColors,
    required int initialCounter,
    BlendMode blend = BlendMode.hardLight}) {
  _counter = initialCounter;
  _colors = initialColors;
  _blend = blend;

  _controller = AnimationController(
    vsync: vsync,
    upperBound: 2,
    duration: const Duration(seconds: 10),
  )..repeat();
  _addPointController = AnimationController(
    vsync: vsync,
    duration: const Duration(milliseconds: 500),
  );
  _addPointAnimation =
      _addPointController.drive(CurveTween(curve: Curves.ease));
}