Animated Number flutter 包
这是一个为Flutter开发的自定义小部件,它具有一些出色的功能,可以让用户在使用数字时更加满意。
预览
入门
支持的平台
| Android | iOS | Linux | macOS | Web | Windows | |
|---|---|---|---|---|---|---|
| 支持 | SDK 16+ | 9.0+ | 任意 | 10.11+ | 任意 | 任意 |
用法
要使用此插件,请将 animated_number 添加为 pubspec.yaml 文件中的依赖项。
示例
AnimatedNumber(
startValue: 0,
endValue: 2000,
duration: Duration(seconds: 2),
isFloatingPoint: false,
style: TextStyle(
color: Colors.orange,
fontSize: 24,
),
)
AnimatedNumber(
startValue: 0,
endValue: 5500.38273626732,
duration: Duration(seconds: 5),
isFloatingPoint: true,
decimalPoint: 4,
style: TextStyle(
color: Colors.lightBlue,
fontSize: 42,
),
)
特点
| 属性 | 类型 | 描述 |
|---|---|---|
| startValue | num | 期望的起始值。 |
| endValue | num | 期望的结束值。 |
| duration | 持续时间 | 动画持续时间。 |
| isFloatingPoint | 布尔值 | 控制动画迭代是整数还是浮点数的标志。 |
| decimalPoint | 整数 | 期望的小数位数。 |
| style | TextStyle? | 文本样式。 |
| textAlign | TextAlign? | 文本应如何水平对齐。 |
| prefixText | String? | 期望的前缀文本。 |
| sufixText | String? | 期望的后缀文本。 |
联系方式
如有任何问题、疑问或改进建议,请随时与我联系。
许可证
MIT
