Search packages, repositories and app categories

flutter_numeric_text cover
Package detailsv1.3.3

flutter_numeric_text

This widget allows you to animate any text. The widget is easy to use and allows you to seamlessly replace Text(data) with NumericText(data).

AndroidiOSWebmacOSWindowsLinux
30-day downloads
945
Likes
28
Pub points
160

Install package

flutter pub add flutter_numeric_text

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

flutter_numeric_text is a Flutter package that enables smooth numeric animations for text display. It replaces standard Text widgets with animated numeric transitions, ideal for counters, scores, or any value that changes over time. The widget is simple to integrate—just swap Text(data) with NumericText(data)—and supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux. It provides a seamless visual experience with minimal setup, making it perfect for dynamic UI elements requiring fluid number updates.

Use cases

  • Animated counters
  • Score displays
  • Dynamic data visualization
  • Real-time number updates
  • Interactive dashboards

Key features

  • Smooth numeric animation
  • Simple API replacement
  • Cross-platform support
  • Minimal configuration
  • Customizable speed
  • Automatic digit handling

Suitable for

  • Developers needing animated numbers
  • UI designers enhancing dashboards
  • Apps with real-time metrics
  • Gamification features
  • Simple yet polished animations

Considerations

  • Best suited for numeric values only
  • May impact performance with high-frequency updates
  • Limited to integer and decimal numbers
  • Not intended for non-numeric text
  • Requires careful tuning for very fast updates

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Text(data) → NumericText(data)

This widget allows you to animate any text. The animation is reminiscent of the text animation in SwiftUI's .numericText(value:). The widget is easy to use and allows you to seamlessly replace Text(data) with NumericText(data).

Features

  • Automatic text animation
  • Minimal configuration required to get started
  • Supports almost all parameters of the Text() widget
  • No external dependencies required

Usage

import 'package:flutter_numeric_text/flutter_numeric_text.dart';

class MyWidget extends StatelessWidget {
  const MyWidget({super.key});

  @override
  Widget build(BuildContext context) {
    // Simply add the widget, and when its value changes,
    // it will automatically trigger the animation.

    // To use the widget, you only need to provide
    // a data value, other fields are optional.

    NumericText(
      "12345 or text",
      duration: const Duration(milliseconds: 300),
      style: const TextStyle(fontSize: 24, color: Colors.black),
      textAlign: TextAlign.center,
      textDirection: TextDirection.ltr,
      locale: const Locale("en", "US"),
      softWrap: true,
      overflow: TextOverflow.ellipsis,
      maxLines: 1,
      semanticsLabel: "Numeric value",
    );
  }
}
With GoogleFonts
...
    NumericText(
      "12345 or text",
      duration: const Duration(milliseconds: 300),
      style: GoogleFonts.<your_font>(
        fontSize: 24,
        color: Colors.black,
        // Just a friendly reminder to add the [textStyle] field.
        // It'll make sure everything calculates correctly.
        textStyle: Theme.of(context).textTheme.bodyMedium,
      ),
    );
...

Installation

To use this package, add it to your pubspec.yaml file:

dependencies:
  flutter_numeric_text: ^1.0.0 # Replace with the latest version

Contributing

Contributions are welcome! If you have suggestions for improvements or find bugs, please open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Categories

Source repository

Projects using this package

No data available yet.