return Material(
child: Center(
child: Stack(
children: <Widget>[
Container(
alignment: Alignment.center,
child: new Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Stack(
children: <Widget>[Positioned(
top: 15,
left: 5,
child: Container(
alignment: Alignment.center,
width: 25.0,
height: 25.0,
decoration: new BoxDecoration(
shape: BoxShape.circle,
color: const Color(0XFFE6E6E6),
border: new Border.all(
width: 0.0,
color: Colors.white,
),
),
)
),
Center(
child: Radio(
groupValue: null,
onChanged: (Null value) {},
value: null,
),
)
],
)
}我正在网格视图中实现单选按钮,我想在上面的container.The代码中创建一个单选按钮,而不是将单选按钮放在容器中。
发布于 2019-03-01 21:09:35
试试这个吧。您可以根据需要获取代码。
Material(
child: Container(
height: 200.0,
decoration: new BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
),
child: Center(
child: Stack(
children: <Widget>[
Container(
alignment: Alignment.center,
child: new Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Stack(
alignment: Alignment.center,
children: <Widget>[
Container(
alignment: Alignment.center,
width: 20.0,
height: 20.0,
decoration: new BoxDecoration(
shape: BoxShape.circle,
color: const Color(0XFFE6E6E6),
border: new Border.all(
width: 0.0,
color: Colors.white,
),
),
),
Padding(
padding: EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0),
child: Radio(
groupValue: null,
onChanged: (Null value) {},
value: null,
),
)
],
)
],
// child: contentInCircle,
),
),
],
),
),
))https://stackoverflow.com/questions/54944577
复制相似问题