Open danijorda1 opened 11 months ago
Looking at the code I don't see any logic in the AnimatedDigitWidget for animating color changes. The color provided to the textStyle property is static, and if it changes, the widget will redraw with the new color, but it won't animate between colors.
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, );
How does AnimatedDigitWidget handle dynamic changes to its properties.?