How to set the radio button as indicated in the dart component

I need to show the green switches as indicated based on the model value. HTML has two radio input elements:

<input name="color" type="radio" id="red" value="red"></label>
<input name="color" type="radio" id="green" value="green" checked>

The dart code has the variable colorValue = 'green'. How can I set a valid attribute of an input element based on a dart variable? Can this be done in HTML, or should it be done in dart code?

+3
source share
1 answer
<input ... checked?="{{colorValue=='green'}}">
+1
source

All Articles