Flutter 颤振创建圆形容器内的单选按钮 退料( 儿童:中心( 子:堆栈( 儿童:[ 容器( 对齐:对齐.center, 孩子:新的一排( crossAxisAlignment:crossAxisAlignment.center, mainAxisAlignment:mainAxisAlignment.start, 儿童:[ 堆叠( 儿童:[定位]( 前15名, 左:5,, 子:容器( 对齐:对齐.center, 宽度:25.0, 身高:25.0, 装饰:新盒子装饰( 形状:BoxShape.circle, 颜色:常量颜色(0xFFE6E6), 边界:新边界( 宽度:0.0, 颜色:颜色,白色, ), ), ) ), 中心( 孩子:收音机( groupValue:null, onChanged:(空值){}, 值:null, ), ) ], ) }

Flutter 颤振创建圆形容器内的单选按钮 退料( 儿童:中心( 子:堆栈( 儿童:[ 容器( 对齐:对齐.center, 孩子:新的一排( crossAxisAlignment:crossAxisAlignment.center, mainAxisAlignment:mainAxisAlignment.start, 儿童:[ 堆叠( 儿童:[定位]( 前15名, 左:5,, 子:容器( 对齐:对齐.center, 宽度:25.0, 身高:25.0, 装饰:新盒子装饰( 形状:BoxShape.circle, 颜色:常量颜色(0xFFE6E6), 边界:新边界( 宽度:0.0, 颜色:颜色,白色, ), ), ) ), 中心( 孩子:收音机( groupValue:null, onChanged:(空值){}, 值:null, ), ) ], ) },flutter,Flutter,我正在gridview中实现radiobutton我想在容器内创建一个单选按钮。我上面尝试的代码没有将单选按钮放在容器内。试试这个。您可以根据需要获取代码 return Material( child: Center( child: Stack( children: <Widget>[ Container( alignment: Alignment.center,

我正在gridview中实现radiobutton我想在容器内创建一个单选按钮。我上面尝试的代码没有将单选按钮放在容器内。

试试这个。您可以根据需要获取代码

      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,
                        ),
                      )
                    ],
                  )
  }
材料(
子:容器(
高度:200.0,
装饰:新盒子装饰(
颜色:颜色,白色,
形状:BoxShape.circle,
),
儿童:中心(
子:堆栈(
儿童:[
容器(
对齐:对齐.center,
孩子:新的一排(
mainAxisAlignment:mainAxisAlignment.center,
儿童:[
堆叠(
对齐:对齐.center,
儿童:[
容器(
对齐:对齐.center,
宽度:20.0,
身高:20.0,
装饰:新盒子装饰(
形状:BoxShape.circle,
颜色:常量颜色(0xFFE6E6),
边界:新边界(
宽度:0.0,
颜色:颜色,白色,
),
),
),
填充物(
填充:从LTRB(0.0,0.0,0.0,0.0)开始的边缘设置,
孩子:收音机(
groupValue:null,
onChanged:(空值){},
值:null,
),
)
],
)
],
//孩子:contentincille,
),
),
],
),
),
))
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,
              ),
            ),
          ],
        ),
      ),
    ))