animated_digit
animated_digit copied to clipboard
Dynamic color change is not compatible
I am trying to run a colour animation on top of AnimatedDigitWidget but it doesn't seem to work:
AnimatedBuilder( animation: _colorAnimation!, builder: (context, child) { print("Current Color: ${_colorAnimation.value}"); return AnimatedDigitWidget( value: int.parse(snapshotStorage?.data?["balance"].toString() ?? "0")/100, textStyle: GoogleFonts.dmSans( fontSize: 34 * ffem, fontWeight: FontWeight .w700, height: 1 * ffem / fem, color: _colorAnimation?.value), //color: const Color(0xff171310)), fractionDigits: (int.parse(snapshotStorage?.data?["balance"].toString() ?? "0")/100) % 1 == 0 ? 0 : 2, suffix: " €", enableSeparator: true, duration: Duration(milliseconds: 700), curve: Curves.easeInOutCirc, ); }),
................
_controller = AnimationController( duration: Duration(milliseconds: 700), vsync: this, );
_colorAnimation = ColorTween(begin: Colors.green, end: Colors.red).animate(_controller!);
_controller!.forward();
How does AnimatedDigitWidget handle dynamic changes to its properties.?