Skip to content

Instantly share code, notes, and snippets.

@TheNova22
Created June 24, 2020 12:46
Show Gist options
  • Save TheNova22/afabb25ce8e294a60504f45c69226ddc to your computer and use it in GitHub Desktop.
Save TheNova22/afabb25ce8e294a60504f45c69226ddc to your computer and use it in GitHub Desktop.
Radio
// vim: syntax=dart
<Widget>[
Text(
'Which name would you finalise:',
),
ListTile(
title: Text(tname),
leading: Radio(value: NameSetter.presentName, groupValue: _pres, onChanged: (NameSetter val){
setState(() {
_pres = val;
tname = name;
});
}),
),
ListTile(
title: Text("Anonymous"),
leading: Radio(value: NameSetter.anonymous, groupValue: _pres, onChanged: (NameSetter val){
setState(() {
_pres = val;
tname = "Anonymous";
});
}),
),
MaterialButton(
child: Text("Set"),
textColor: Colors.black,
color: fix,
onPressed: (){
setState(() {
name = tname;
});
},
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment