![](/img/trans.png)
[英]Using a Circular Progress Indicator with Firebase Animated List in Flutter
[英]How to Set the Loading Value for the Circular progresss Indicator like progress percentage for 60 days in flutter?
如何設置循環進度指示器的加載值,例如 flutter 中 60 天的進度百分比 - 數學公式?我的 flutter 項目需要這些東西,對不起,如果我問的是愚蠢的事情:-)注意:我是新手驚人的 flutter 開發。
您可以像這樣設置進度指示器的“完成”率:
CircularProgressIndicator(value: 0.5)
以上將產生一個 50% 的指標。 您所要做的就是在StatefulWidget
中使用成員作為值,並使用setState
根據所需的百分比對其進行更新。
您還可以使用它來指示加載圖像時的進度:
Image.network(
'<url>',
height: 50,
loadingBuilder: (BuildContext context, Widget child,
ImageChunkEvent? loadingProgress) {
if (loadingProgress == null) {
return child;
}
return Center(
child: CircularProgressIndicator(
value: loadingProgress.expectedTotalBytes != null
? loadingProgress.cumulativeBytesLoaded /
loadingProgress.expectedTotalBytes!
: null,
),
);
},
)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.