I have a Radio
button inside a ListTile
. When the ListTile
is clicked, I change the Radio
's value. I don't want the radio to be clickable, so I don't provide an onChanged
callback:
ListTile(
onTap: () => onChanged(template.id),
leading: Radio(
value: template.id,
groupValue: checkedId,
)
...
)
Doing that, the Radio
becomes "inactive" and changes it's color to grey.
The Radio
has an activeColor
property, but not for inactive.
If I provide a dummy function to Radio
's onChanged
property - it becomes active, but the problem is I don't want it to be clickable, I want the ListTile
to be clickable only (the reason is - I want to be able to uncheck the Radio
)
Also, I only want to change the inactive color of those specific Radio
buttons, and not for the whole app.
Current Result:
Result with onChange
(I can't uncheck the radio when clicking on it):
Radio
blue also when not selected. The following will fix this:disabledColor: template.ai == checkedAi ? Colors.blue : null,
Thank you – Einkorn