Search packages, repositories and app categories

animated_text_lerp cover
Package detailsv2.0.0

animated_text_lerp

Simple widgets to animate between number or string text. Useful for number increase/decrease animation, currency value animation or string content changing animation.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
2.1K
Likes
60
Pub points
150

Install package

flutter pub add animated_text_lerp

Package Overview

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

AnimatedTextLerp is a Flutter package that provides simple widgets to smoothly animate between numeric or string values. It enables fluid transitions for dynamic text, such as increasing or decreasing numbers, currency updates, or changing text content with visual continuity. Ideal for dashboards, counters, and real-time data displays, it leverages interpolation (lerp) for smooth visual effects without complex animations. The package supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux.

Use cases

  • Real-time number counters
  • Currency value updates
  • Dynamic text transitions
  • Dashboard metrics
  • Loading progress indicators
  • Animated statistics

Key features

  • Smooth lerp-based animation
  • Supports both numbers and strings
  • Minimal setup required
  • Cross-platform compatibility
  • Customizable duration and curve
  • Built-in easing functions

Suitable for

  • Simple animated counters
  • Data visualization widgets
  • User interface enhancements
  • Educational apps
  • Financial dashboards

Considerations

  • Not ideal for complex animations
  • Limited customization beyond basic properties
  • Best suited for small text changes
  • May impact performance with high-frequency updates
  • Requires careful handling of string formatting

Original README

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

pub package

Simple widgets to animate between number or string text. Useful for number increase/decrease animation, currency value animation or string content changing animation.

Features

  • Similar to a simple Text widget.
  • Animating between number (int or double) with AnimatedNumberText.
  • Animating between string, which will lerp each character respectively with AnimatedStringText.
  • TextStyle animation supported.
  • Think of Flutter's pre-built animated widget like AnimatedOpacity, AnimatedAlign, ..., but with text.

Getting started

  • First import it:
import 'package:animated_text_lerp/animated_text_lerp.dart';

Usage

AnimatedNumberText

The widget support lerping between number values. Just setState with the current value and the widget will start animating to it.

AnimatedNumberText(
  value, // int or double
  curve: Curves.easeIn,
  duration: const Duration(seconds: 1),
  style: const TextStyle(fontSize: 30),
  formatter: (value) {
    final formatted =
    intl.NumberFormat.currency(locale: "en").format(value);
    return formatted;
  },
)

AnimatedStringText

The widget support lerping between string values. Just setState with the current value and the widget will start animating to it. Each character will lerp to the new corresponding one respectively.

AnimatedStringText(
  value, // string
  curve: Curves.easeIn,
  duration: const Duration(seconds: 1),
  style: const TextStyle(fontSize: 30),
)

Categories

Source repository

Projects using this package

No data available yet.