搜索插件、代码仓与 APP 分类

animated_flip_counter 封面
插件详情v0.3.4

animated_flip_counter

一个隐式动画小部件,可从一个数字翻转到另一个数字,支持自定义样式、小数和负值。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
7.2万
喜欢数
653
Pub 分数
150

安装插件

flutter pub add animated_flip_counter

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个 Flutter 小部件,可在数字之间切换时创建平滑的动画翻转效果。它支持自定义样式、小数位数和负值,非常适合应用程序中的动态计数器。动画是隐式的,意味着它会自动处理过渡,而无需显式动画控制器。非常适合用于分数显示、计时器或任何需要视觉上引人入胜的数字变化的 UI 元素。

适合场景

  • 游戏中的得分追踪
  • 计时器显示
  • 动态数据可视化
  • 进度指示器
  • Countdowns
  • 财务仪表盘

主要特点

  • 平滑翻转动画
  • 可自定义文本样式
  • 支持小数
  • 处理负数
  • 隐式动画控制
  • 跨平台兼容性

适合对象

  • 游戏开发者
  • 仪表板创建者
  • UI/UX 设计师
  • 实时数据应用
  • 交互式组件

使用建议

  • 多个实例可能影响性能
  • 仅限数值
  • 需要仔细的样式设置以确保可读性
  • 不适用于高频更新
  • 最好与中等动画持续时间配合使用

原始 README

以下为关联源码仓库的 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.

Animated Counter

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

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.

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.

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

所属分类

源码仓库

使用此插件的项目