Flutter-Radio單選框

Container(
                    child: Radio<String>(
                        value: "男",
                        activeColor: Colors.red,//激活時的顏色
                        groupValue: _newValue,//選中的值
                        onChanged: (value) {
                          setState(() {
                            _newValue = value;
                          });
                        }
                     ),
                  ),
                  Text('男'),
                  Container(
                    child: Radio<String>(
                        value: "女",
                        groupValue: _newValue,
                        onChanged: (value) {
                          setState(() {
                            _newValue = value;
                          });
                        }
                    ),
                  ),
                  Text('女'),
原文地址:https://www.cnblogs.com/ssjf/p/12054500.html