当前位置:   article > 正文

Flutter CircularProgressIndicator圆形进度指示器_flutter circularprogressindicator设置大小

flutter circularprogressindicator设置大小

此组件直接写出来就可以使用了,不需要添加多余的东西

也可以添加各种属性如:

value当前进度:0~1之间的值

valueColor:进度条当前进度颜色,

starokWidth:最小宽,默认4.0

color:Colors.red//进度条颜色

backgroundColor:COlors.grey//背景颜色

  1. class MyApp1 extends StatefulWidget {
  2. const MyApp1({Key? key}) : super(key: key);
  3. @override
  4. _MyApp1State createState() => _MyApp1State();
  5. }
  6. class _MyApp1State extends State<MyApp1> {
  7. @override
  8. Widget build(BuildContext context) {
  9. return Scaffold(
  10. body: Center(
  11. child: AnimatedContainer(
  12. width: 50,
  13. height: 50,
  14. duration: Duration(seconds: 1),
  15. child: CircularProgressIndicator(
  16. strokeWidth: 5, //设置进度条的宽
  17. color: Colors.red, //设置进度条颜色
  18. backgroundColor: Colors.grey, //设置进度条背景颜色
  19. ),
  20. ), //圆形进度指示器
  21. ),
  22. );
  23. }
  24. }

效果图

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/289657
推荐阅读
相关标签
  

闽ICP备14008679号