簡體   English   中英

如何在 flutter 中創建圓形進度條

[英]How to create a circular progress bar in flutter

我試圖弄清楚如何在 flutter 的容器內彎曲一個小尺寸的盒子。

我目前的代碼只是在邊界內創建了一個巨大的圓圈。

      decoration: BoxDecoration(border: Border.all(),
       shape: BoxShape.circle),
       width: 112,
       height: 112,
       child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
         children: [
         Flexible(
          child: FractionallySizedBox(
          widthFactor:.90,                
          child: Container(
          decoration: BoxDecoration(
          shape: BoxShape.circle,
          color: Colors.green,),),

這是我想要實現的目標(但綠色條僅顯示 20% 而不是此處顯示的 100%):

圓圖

為什么不在堆棧中使用 CircularProgressIndicator 小部件和 Text 小部件?

您可以像這樣設置 strokeWidth 和 circularProgressIndicator 的進度:

CircularProgressIndicator(
            value: yourProgress,
            strokeWidth: yourStrokeWidth)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM