AnimatedStatCard constructor
const
AnimatedStatCard({
- Key? key,
- required num value,
- required String label,
- IconData? icon,
- int decimals = 0,
- Duration duration = const Duration(milliseconds: 1000),
- Curve curve = Curves.easeOut,
- TextStyle? valueStyle,
- TextStyle? labelStyle,
- Color? activeColor,
- bool scalePulse = false,
- Color? cardColor,
- double elevation = 2,
- EdgeInsetsGeometry padding = const EdgeInsets.all(20),
- bool autoplay = true,
- String format()?,
Creates an animated statistics card.
value — target numeric value to animate toward (required).
label — label text below the value (required).
icon — optional icon above the value.
decimals — decimal places to display.
duration — animation duration.
curve — easing curve for value interpolation.
valueStyle — text style for the animated value.
labelStyle — text style for the label.
activeColor — optional color interpolation target.
scalePulse — scale pulse near completion.
cardColor — background color of the card.
elevation — card shadow depth.
padding — padding around card content.
autoplay — whether animation starts automatically.
format — optional custom formatter for the number.
Implementation
const AnimatedStatCard({
super.key,
required this.value,
required this.label,
this.icon,
this.decimals = 0,
this.duration = const Duration(milliseconds: 1000),
this.curve = Curves.easeOut,
this.valueStyle,
this.labelStyle,
this.activeColor,
this.scalePulse = false,
this.cardColor,
this.elevation = 2,
this.padding = const EdgeInsets.all(20),
this.autoplay = true,
this.format,
});