v2.2.2
timer_count_down
简单的倒计时计时器。用于创建一个简单计时器。纯代码实现。
201喜欢 3.1万近 30 天下载150Pub 分数
AndroidiOSWebmacOSWindowsLinux
Flutter 的简单倒计时(计时器)
以下为英文项目原文快照,最新内容请访问 GitHub。
A highly customizable countdown widget for Flutter, with support for custom styling, intervals, and onFinished callbacks.
dependencies:
flutter:
sdk: flutter
timer_count_down: ^2.2.2
Run this in your terminal or click on pub get
$ flutter pub get
Simple example for the usage of the package is shown below.
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Countdown(
seconds: 20,
build: (BuildContext context, double time) => Text(time.toString()),
interval: Duration(milliseconds: 100),
onFinished: () {
print('Timer is done!');
},
);
}
}
For pause, restart and resume you need to use CountdownController.
For an example of using the package, please check the example folder. Otherwise, keep reading and keep going!
依赖清单 3 项
{"sdk":"flutter"}^1.3.0^1.9.0先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗