flutter - 我如何在颤动中获得这种计时器类型的视频播放器?
解决方案
您可以通过添加此插件并像这样使用它来做到这一点:
Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: CircularCountDownTimer(
// Countdown duration in Seconds
duration: 10,
// Width of the Countdown Widget
width: MediaQuery.of(context).size.width / 2,
// Height of the Countdown Widget
height: MediaQuery.of(context).size.height / 2,
// Default Color for Countdown Timer
color: Colors.white,
// Filling Color for Countdown Timer
fillColor: Colors.red,
// Border Thickness of the Countdown Circle
strokeWidth: 5.0,
// Text Style for Countdown Text
textStyle: TextStyle(
fontSize: 22.0,
color: Colors.black87,
fontWeight: FontWeight.bold),
// true for reverse countdown (max to 0), false for forward countdown (0 to max)
isReverse: false,
// Function which will execute when the Countdown Ends
onComplete: () {
// Here, do whatever you want
print('Countdown Ended');
},
))
推荐阅读
- wso2esb - 从 WSO2IS 检索范围详细信息的 SOAP 服务
- django - 我对 django 身份验证功能有疑问
- algorithm - deleteMin 左倾红黑树需要更多解释
- sql - 如果 C# 中的输入值为空,则将 NULL 插入 SQL Server 数据库
- c# - Unity如何序列化和反序列化复杂的嵌套json?
- php - 数组上的 PHPUnit assertDataHas()
- c++ - 为什么 'typeid(x) == typeid(y)' 评估为真,其中 'x' 和 'y' 分别是 T 和 T& 类型的 id 表达式?
- javascript - Laravel 将对象返回给 javascript 得到 Uncaught SyntaxError: Unexpected token '&' 错误
- python - Tkinter GUI 中 for 循环内 after() 方法的行为
- soap - 从 pl/sql 构建 Soap Security 标头