繁体   English   中英

如何创建两级循环进度指示器?

[英]How to create two level circular progress indicator?

以下是我想要实现的

在此处输入图片说明

我正在查看 Circular Percent Indicator 库,但它不提供此功能

以下是在原生Android开发https://github.com/grmaciel/two-level-circular-progress-bar中实现的

但是如何将它移植到 Flutter?

您可以通过使用stack小部件来实现此效果,它将允许您将两个指标放置在相同的位置,从而获得重叠完成的效果:

Stack(
  children: <Widget>[
    CircularProgressIndicator(
      value: 0.8,
      valueColor: AlwaysStoppedAnimation<Color>(Colors.purple),
    ),
    CircularProgressIndicator(
      value: 0.6,
      valueColor: AlwaysStoppedAnimation<Color>(Colors.green),
    ),
  ]
);

试试这个, percent_indicator库,

        new CircularPercentIndicator(
                radius: 130.0,
                animation: true,
                animationDuration: 1200,
                lineWidth: 15.0,
                percent: 0.4,
                center: Center(
                       child: Icon(Icons.location_on),
                        ),
                circularStrokeCap: CircularStrokeCap.butt,
                backgroundColor: Colors.deepPurple,
                progressColor: Colors.green,
              ),

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM