Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to show active mark on RadioListTile?

How to show active mark on RadioListTile? I used selected and activeColor but it does not work.

RadioListTile(
  selected: true,
  activeColor: Theme.of(context).primaryColor, //
  title: Text(AppLocalizations.key(context, 'setDark')),
  value: ThemeMode.dark,
  groupValue: _themeMode,
  onChanged: (value) {},
),

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Documentation

"groupValue → T?

The currently selected value for this group of radio buttons.

This radio button is considered selected if its value matches the groupValue.
"

The one selected is the one whose group value matches the value.

Therefore your radio buttons should have as groupValue Theme.Dark or Theme.Light and update it on onChanged.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading