RollingDigitCounter constructor

const RollingDigitCounter({
  1. Key? key,
  2. required num value,
  3. int decimals = 0,
  4. Duration duration = const Duration(milliseconds: 1000),
  5. TextStyle? style,
  6. bool autoplay = true,
  7. bool keepAlive = true,
  8. double digitWidth = 28,
  9. double digitHeight = 40,
  10. Color? backgroundColor,
})

Creates an odometer-style rolling digit counter.

value — target numeric value to animate toward (required). decimals — decimal places to display. duration — animation duration. style — text style for the digits. autoplay — whether animation starts automatically. keepAlive — preserves animation state in scroll-off. digitWidth — width of each digit box in pixels. digitHeight — height of each digit box in pixels. backgroundColor — background color of each digit box.

Implementation

const RollingDigitCounter({
  super.key,
  required this.value,
  this.decimals = 0,
  this.duration = const Duration(milliseconds: 1000),
  this.style,
  this.autoplay = true,
  this.keepAlive = true,
  this.digitWidth = 28,
  this.digitHeight = 40,
  this.backgroundColor,
});