FLUTTER ECOSYSTEM

strash/flutter_numeric_text

어떤 텍스트든 애니메이션화할 수 있는 Flutter 위젯입니다.

flutter_numeric_text 프로젝트 이미지
Stars
14
Forks
3
최근 푸시(UTC)
2025. 3. 24.
프로젝트 상태
활성
one GitHub avatar
언어DartC++CMakeSwiftCHTMLKotlinObjective-C

기술 주제

이 저장소가 배포한 패키지

사용 중인 의존성

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

원본 README

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

README 펼치기 / 접기

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

https://raw.githubusercontent.com/strash/flutter_numeric_text/refs/heads/main/resources/demo.gif
  • 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.