AnimatedStatCard constructor

const AnimatedStatCard({
  1. Key? key,
  2. required num value,
  3. required String label,
  4. IconData? icon,
  5. int decimals = 0,
  6. Duration duration = const Duration(milliseconds: 1000),
  7. Curve curve = Curves.easeOut,
  8. TextStyle? valueStyle,
  9. TextStyle? labelStyle,
  10. Color? activeColor,
  11. bool scalePulse = false,
  12. Color? cardColor,
  13. double elevation = 2,
  14. EdgeInsetsGeometry padding = const EdgeInsets.all(20),
  15. bool autoplay = true,
  16. String format(
    1. num
    )?,
})

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,
});