颤振中的响应式循环进度指示器

时间:2021-04-27 10:24:28

标签: flutter dart flutter-layout flutter-animation

下面的代码手动更改圆形进度指示器的大小,方法是将它包裹在大小的框周围并给出尺寸。 我想让它具有响应性,以便它可以适应各种屏幕尺寸。

SizedBox(
              width: 50,
              height: 50,
              child: CircularProgressIndicator(
                 value: 0.5,
                backgroundColor: Color(0xff19454A),
                valueColor: AlwaysStoppedAnimation(Color(0xff0b6f75)),
                strokeWidth: 8,

              ),
            ),

1 个答案:

答案 0 :(得分:1)

SizedBox(
              width: MediaQuery.of(context).size.width*0.2,
              height: MediaQuery.of(context).size.width*0.2,
              child: CircularProgressIndicator(
                 value: 0.5,
                backgroundColor: Color(0xff19454A),
                valueColor: AlwaysStoppedAnimation(Color(0xff0b6f75)),
                strokeWidth: 8,

              ),
            ),