FLUTTER ECOSYSTEM

h65wang/flutter-animated-counter

한 숫자에서 다른 숫자로 전환되는 암시적 애니메이션 위젯입니다.

flutter-애니메이션 카운터 프로젝트 이미지
Stars
145
Forks
45
최근 푸시(UTC)
2024. 8. 13.
프로젝트 상태
활성
Bradley Wang GitHub avatar
GITHUB User

Bradley Wang ↗

언어DartHTMLSwiftKotlinObjective-C

기술 주제

이 저장소가 배포한 패키지

사용 중인 의존성

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

원본 README

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

README 펼치기 / 접기

animated_flip_counter

An implicit animation widget that flips from one number to another.

Usage

It can be useful to display information that's constantly changing.

https://github.com/h65wang/flutter-animated-counter/raw/master/gifs/demo.gif
Animated Counter

Simply pass in a value and an optional duration and curve, just like any other implicit animation widget in Flutter.

https://github.com/h65wang/flutter-animated-counter/raw/master/gifs/counter.gif
AnimatedFlipCounter(
  duration: Duration(milliseconds: 500),
  value: _value, // pass in a value like 2014
)
Decimal Display

Use fractionDigits to specify how many digits to show after the decimal point. It handles negative values as well.

https://github.com/h65wang/flutter-animated-counter/raw/master/gifs/percent.gif
AnimatedFlipCounter(
  value: _value,
  fractionDigits: 2, // decimal precision
  suffix: "%",
  textStyle: TextStyle(
      fontSize: 40,
      color: _value >= 0 ? Colors.green : Colors.red,
  ),
)
Custom Style

Use the familiar TextStyle parameter for styling, and use prefix and suffix for additional texts.

https://github.com/h65wang/flutter-animated-counter/raw/master/gifs/style.gif
AnimatedFlipCounter(
  value: _value,
  prefix: "Level ",
  textStyle: TextStyle(
    fontSize: 80,
    fontWeight: FontWeight.bold,
    letterSpacing: -8.0,
    color: Colors.yellow,
    shadows: [
      BoxShadow(
        color: Colors.orange,
        offset: Offset(8, 8),
        blurRadius: 8,
      ),
    ],
  ),
)