animated_count_text 1.0.1
animated_count_text: ^1.0.1 copied to clipboard
A lightweight animated text widget that smoothly counts between numeric values when they change. Supports integers, decimals, currency formatting, percentages, and custom animation curves.
Animated Count Text #
A lightweight Flutter widget that smoothly animates numeric text whenever the value changes.
Supports integers, decimals, currency symbols, percentages, custom curves, and configurable precision.
Preview #
Use this package as a library #
Depend on it #
Run this command:
With Flutter:
flutter pub add animated_count_text
This will add a line like this to your package's pubspec.yaml:
dependencies:
animated_count_text: ^latest_version
Alternatively, you can manually add it to your pubspec.yaml and run:
flutter pub get
Import it #
Now in your Dart code, you can use:
import 'package:animated_count_text/animated_count_text.dart';
Usage #
Basic Example #
AnimatedCount(
value: 30,
)
With Currency #
AnimatedCount(
value: 2500,
prefix: "₹ ",
duration: Duration(milliseconds: 800),
)
With Decimal Precision #
AnimatedCount(
value: 12.3456,
fractionDigits: 2,
)
With Percentage #
AnimatedCount(
value: 87.5,
suffix: "%",
fractionDigits: 1,
)
Properties #
| Property | Type | Description |
|---|---|---|
value |
num |
The number to animate to |
fractionDigits |
int |
Decimal precision (default: 0) |
prefix |
String? |
Text before the number |
suffix |
String? |
Text after the number |
duration |
Duration |
Animation duration |
curve |
Curve |
Animation curve |
style |
TextStyle? |
Text styling |
textAlign |
TextAlign? |
Text alignment |
License #
MIT License