Android 如何在颤振状态下将一个循环压缩机指示器放入另一个循环压缩机指示器中?
我试着这么做,但结果一个接一个。Android 如何在颤振状态下将一个循环压缩机指示器放入另一个循环压缩机指示器中?,android,ios,flutter,dart,progress-indicator,Android,Ios,Flutter,Dart,Progress Indicator,我试着这么做,但结果一个接一个。循环压缩机指示器堆叠在一起,而不是像我在以下代码中尝试的那样位于内部: body: Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ S
循环压缩机指示器
堆叠在一起,而不是像我在以下代码中尝试的那样位于内部:
body: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(
height: 200,
width: 200,
child: Column(
children: <Widget>[
CircularProgressIndicator(
backgroundColor: Colors.pinkAccent,
strokeWidth: 30.0,
value: 0.7,
valueColor: AlwaysStoppedAnimation<Color>(Colors.black),
),
SizedBox(
height: 150,
width: 150,
child: CircularProgressIndicator(
backgroundColor: Colors.red,
strokeWidth: 10.0,
value: 0.7,
valueColor: AlwaysStoppedAnimation<Color>(Colors.black),
),
),
],
),
),
],
),
),
主体:中心(
子:列(
crossAxisAlignment:crossAxisAlignment.center,
mainAxisAlignment:mainAxisAlignment.center,
儿童:[
大小盒子(
身高:200,
宽度:200,
子:列(
儿童:[
循环压缩机指示器(
背景颜色:Colors.pinkAccent,
冲程宽度:30.0,
数值:0.7,
valueColor:AlwaysStoppedAnimation(颜色.黑色),
),
大小盒子(
身高:150,
宽度:150,
子对象:循环压缩机指示器(
背景颜色:Colors.red,
冲程宽度:10.0,
数值:0.7,
valueColor:AlwaysStoppedAnimation(颜色.黑色),
),
),
],
),
),
],
),
),
您必须使用堆栈小部件将这些小部件堆叠在彼此的顶部
Stack(
children: <Widget>[
SizedBox(
height: 200,
width: 200,
child: CircularProgressIndicator(
backgroundColor: Colors.pinkAccent,
strokeWidth: 30.0,
value: 0.7,
valueColor: AlwaysStoppedAnimation<Color>(Colors.black),
),
),
Positioned(
left: 25,
top: 25,
child: SizedBox(
height: 150,
width: 150,
child: CircularProgressIndicator(
backgroundColor: Colors.red,
strokeWidth: 10.0,
value: 0.7,
valueColor: AlwaysStoppedAnimation<Color>(Colors.black),
),
),
)
],
),
堆栈(
儿童:[
大小盒子(
身高:200,
宽度:200,
子对象:循环压缩机指示器(
背景颜色:Colors.pinkAccent,
冲程宽度:30.0,
数值:0.7,
valueColor:AlwaysStoppedAnimation(颜色.黑色),
),
),
定位(
左:25,
前25名,
孩子:大小盒子(
身高:150,
宽度:150,
子对象:循环压缩机指示器(
背景颜色:Colors.red,
冲程宽度:10.0,
数值:0.7,
valueColor:AlwaysStoppedAnimation(颜色.黑色),
),
),
)
],
),
输出
谢谢你的帮助!