美文网首页
Flutter 动态进度条

Flutter 动态进度条

作者: 技术混子 | 来源:发表于2020-12-09 19:58 被阅读0次

视图比较粗糙,凑合看

需要引入依赖: percent_indicator: ^2.1.1+1

Pasted Graphic.jpg
import 'package:percent_indicator/percent_indicator.dart';
//圆形进度条&&动画&&渐变色

 CircularPercentIndicator(

 radius: 190.0,

 lineWidth: 13.0,

 animation: true,

 animationDuration: 1000,//动画时长

  percent: 0.5,//设置比例

  center: Column(

   mainAxisAlignment: MainAxisAlignment.center,

   children: [

  //自定义 view                                          

  ],

  ),

circularStrokeCap: CircularStrokeCap.round,

backgroundColor: Color.fromRGBO(39, 153, 93, 0.2),

linearGradient: LinearGradient(

begin: Alignment.topCenter,

end: Alignment.bottomCenter,

colors: [

Color.fromRGBO(39, 153, 93, 0.1),

Color.fromRGBO(39, 153, 93, 1)

],

)),
pEt VEnon.jpg
//线形进度条&&动画&&渐变色

LinearPercentIndicator(

 width: MediaQuery.of(context).size.width -

46,

lineHeight: 8.0,

percent: 0.3,//设置比例

animation: true,

animationDuration: 1000,//动画时长

backgroundColor:

Color.fromRGBO(238, 238, 238, 1),

linearGradient: LinearGradient(

begin: Alignment.centerLeft,

end: Alignment.centerRight,

colors: [

Color.fromRGBO(39, 153, 93, 0.1),

 Color.fromRGBO(39, 153, 93, 1)

],

),

),

整理不易,给个赞谢谢!

相关文章

网友评论

      本文标题:Flutter 动态进度条

      本文链接:https://www.haomeiwen.com/subject/vypiiktx.html