AnimatedCounter constructor
const
AnimatedCounter({})
Creates an AnimatedCounter for the given value.
value — target numeric value to animate toward (required).
duration — animation duration from current to target value.
curve — easing curve for value interpolation.
style — text style for the displayed number.
format — optional custom formatter for the displayed string.
autoplay — whether animation starts on mount or value change.
keepAlive — preserves animation state in scroll-off.
decimals — decimal places (0 = integer display).
activeColor — optional color lerp target from style color.
scalePulse — short scale pulse near animation completion.
Implementation
const AnimatedCounter({
super.key,
required this.value,
this.duration = const Duration(milliseconds: 1000),
this.curve = Curves.easeOut,
this.style,
this.format,
this.autoplay = true,
this.keepAlive = true,
this.decimals = 0,
this.activeColor,
this.scalePulse = false,
});