Flutter 動(dòng)態(tài)進(jìn)度條

視圖比較粗糙,湊合看

需要引入依賴(lài): percent_indicator: ^2.1.1+1

Pasted Graphic.jpg
import 'package:percent_indicator/percent_indicator.dart';
//圓形進(jìn)度條&&動(dòng)畫(huà)&&漸變色

 CircularPercentIndicator(

 radius: 190.0,

 lineWidth: 13.0,

 animation: true,

 animationDuration: 1000,//動(dòng)畫(huà)時(shí)長(zhǎng)

  percent: 0.5,//設(shè)置比例

  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
//線形進(jìn)度條&&動(dòng)畫(huà)&&漸變色

LinearPercentIndicator(

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

46,

lineHeight: 8.0,

percent: 0.3,//設(shè)置比例

animation: true,

animationDuration: 1000,//動(dòng)畫(huà)時(shí)長(zhǎng)

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)

],

),

),

整理不易,給個(gè)贊謝謝!

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容