赞
踩
此组件直接写出来就可以使用了,不需要添加多余的东西
也可以添加各种属性如:
value当前进度:0~1之间的值
valueColor:进度条当前进度颜色,
starokWidth:最小宽,默认4.0
color:Colors.red//进度条颜色
backgroundColor:COlors.grey//背景颜色
- class MyApp1 extends StatefulWidget {
- const MyApp1({Key? key}) : super(key: key);
-
- @override
- _MyApp1State createState() => _MyApp1State();
- }
-
- class _MyApp1State extends State<MyApp1> {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- body: Center(
- child: AnimatedContainer(
- width: 50,
- height: 50,
- duration: Duration(seconds: 1),
- child: CircularProgressIndicator(
- strokeWidth: 5, //设置进度条的宽
- color: Colors.red, //设置进度条颜色
- backgroundColor: Colors.grey, //设置进度条背景颜色
- ),
- ), //圆形进度指示器
- ),
- );
- }
- }
效果图
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。