1.简介
Material Design 风格的单选按钮附加文字label
点击文字同时,将会触发Radio的点击效果
2.示例代码
class DemoA extends StatefulWidget {
_Demo createState() => _Demo();
}
class _Demo extends State<DemoA> {
String value = '';
onChange(v){
this.setState((){
value = v;
});
}
@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
RadioListTile<String>(
title: Text('A'),
value: "A",
groupValue: this.value,
isThreeLine: false,
subtitle: Text('subtitleA'),
onChanged: onChange,
),
RadioListTile<String>(
title: Text('B'),
value: "B",
groupValue: this.value,
isThreeLine: false,
subtitle: Text('subtitleB'),
onChanged: onChange,
)
],
);
}
}
网友评论