[英]Flutter create radio button inside the circle container
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,
),
)
],
)
}
I am implementing radiobutton in gridview i want to create a radio button inside the container.The code which i tried above is not placing the radio button inside container.我正在 gridview 中实现单选按钮我想在容器内创建一个单选按钮。我上面尝试的代码不是将单选按钮放在容器内。
try this one.试试这个。 You can get the code as per your need.
您可以根据需要获取代码。
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,
),
),
],
),
),
))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.