1. Count up with TweenAnimationBuilder
TweenAnimationBuilder needs no controller. Give it a Tween and a duration; when you rebuild with a new end value, it animates from the value currently displayed to the new one. The begin value is only used for the very first animation, so begin: 0 makes the number count up when the screen first appears.
FontFeature.tabularFigures() makes every digit the same width, so the text doesn't wobble as numbers change.
import 'package:flutter/material.dart';
class AnimatedCount extends StatelessWidget {
const AnimatedCount({super.key, required this.value, required this.label});
final int value;
final String label;
@override
Widget build(BuildContext context) {
final reduceMotion = MediaQuery.maybeDisableAnimationsOf(context) ?? false;
return Semantics(
// Screen readers get the final value once, not every intermediate number.
label: '$label: $value',
excludeSemantics: true,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(label, style: Theme.of(context).textTheme.labelMedium),
TweenAnimationBuilder<double>(
tween: Tween<double>(begin: 0, end: value.toDouble()),
duration: reduceMotion ? Duration.zero : const Duration(milliseconds: 900),
curve: Curves.easeOutCubic,
builder: (context, current, _) => Text(
current.round().toString(),
style: const TextStyle(
fontSize: 32,
fontWeight: FontWeight.w700,
fontFeatures: [FontFeature.tabularFigures()],
),
),
),
],
),
);
}
}2. Formatting currency and thousands
Format inside the builder so every intermediate frame is formatted too. For locale-aware separators and currency, NumberFormat from the intl package (for example NumberFormat.simpleCurrency()) is the usual choice; create it once outside build rather than every frame.
If the counter can go down as well as up (a balance, a live score), the same widget works: TweenAnimationBuilder animates in whichever direction the new value lies.
3. Kipluo RollingCounter and CountUpStat
Kipluo has two free number widgets in the kipluo package. RollingCounter rolls each digit on its own spring like an odometer, with prefix, suffix and decimals. CountUpStat shows a labelled figure with an optional up or down percentage badge. Both expose the final value through Semantics and settle instantly when animations are disabled; RollingCounter also uses tabular digits.
import 'package:kipluo/kipluo.dart';
RollingCounter(value: balance, prefix: r'$', decimals: 2)
CountUpStat(value: 48210, label: 'Monthly revenue', delta: 12.5)Accessibility checklist
Tick each one off as you check your build. Your ticks stay in this browser.
0 of 3 checked
Build it yourself or install it
Build it yourself when
A few counters on a dashboard. TweenAnimationBuilder is built in and enough.
Install Kipluo when
You want per-digit spring rolling, a delta badge, tick sounds and the same counters on the web.