return CupertinoAlertDialog(
title: Text("888"),
content: StatefulBuilder(
builder: (context,stateContext){
return Material(
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Radio(
value: 0,
groupValue: groupValue,
onChanged: (value){
print(value);
stateContext((){groupValue = value;});
},
),
Text("附件")
],
),
Row(
children: <Widget>[
Radio(
value: 1,
groupValue: groupValue,
onChanged: (value){
stateContext((){groupValue = value;});
},
),
Text("主件")
],
),
Row(
children: <Widget>[
Radio(
value: 2,
groupValue: groupValue,
onChanged: (value){
stateContext((){groupValue = value;});
},
),
Text("全部")
],
)
],
),
);
},
),
actions: <Widget>[
FlatButton(
child: Text("确定"),
onPressed: (){
print("接口还没有进行测试"+groupValue.toString());
// Navigator.pop(context);
},
),
FlatButton(
child: Text("关闭"),
onPressed: (){
Navigator.pop(context);
},
),
],
);
由value与groupValye共同决定,一般固定value的值,onchange里面修改groupValue的值