Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to unselect a radio button in flutter?

I use a map for radio, a textfield, text that displays a result and a button for clear all.

The TextField can be erased :

RaisedButton(onPressed: () { _controllerTextField.clear();},
                  child: Text('Clear',style:Theme.of(context).textTheme.body2.merge(TextStyle(color: Colors.white)),),)

But i don't understand how to erase my Text and put my Radio on default deselected state.

More, when a radio is selected, I give it a custom color but I can not give the same color to the Radio icon.

Do you have an idea of ​​the method to use?

Thank you

like image 558
mbrd Avatar asked Oct 24 '25 02:10

mbrd


1 Answers

Use Radio's toggleable property.

Documentation Set to true if this radio button is allowed to be returned to an indeterminate state by selecting it again when selected.

like image 191
neretzes Avatar answered Oct 25 '25 17:10

neretzes