FLUTTER ECOSYSTEM

SilentCatD/animated_text_lerp

Flutter용 애니메이션 텍스트 패키지입니다. 통화 값 증감 애니메이션 또는 텍스트 콘텐츠의 보간 애니메이션에 유용합니다.

animated_text_lerp 프로젝트 이미지
Stars
7
Forks
1
최근 푸시(UTC)
2024. 12. 23.
프로젝트 상태
활성
SilentCatDev GitHub avatar
GITHUB User

SilentCatDev ↗

MIT Licensed packages developer @ HCMUS ngocphuocnguyen312@gmail.com

Ho Chi Minh City, Viet Nam
언어Dart

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 3 개
  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}
  • flutter_lints개발 의존성^3.0.0

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

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

https://github.com/SilentCatD/animated_text_lerp/blob/main/assets/animated_number_text.gif?raw=true

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

https://github.com/SilentCatD/animated_text_lerp/blob/main/assets/animated_text.gif?raw=true

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),
)