Skip to content

Radio Button

Radio buttons allow users to select one option from a set.

Radio List Tile

Radio Button

RadioListTile<bool>(
  onChanged:(bool? value) { },
  value: false,
  title: const Text('Radio Title'),
),

Radio Button Multiple

Radio Button Multiple

Column(
    children: [
        Radio<int>(
            value: 0,
            groupValue: _groupValue,
            onChanged: (int? value) {},
        ),
        Radio<int>(
            value: 1,
            groupValue: _groupValue,
            onChanged: (int? value) {},
        ),
    ],
)

Info

groupValue The currently selected value for a group of radio buttons.

Customization

To change the whole Radio Button Theme, please open the core/themes/app_theme.dart. Here's how to change the Widget Radio Button theme:

radioTheme: RadioThemeData(
    fillColor: MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) {
        if (states.contains(MaterialState.selected)) {
        return AppColors.secondary;
        } else if (states.contains(MaterialState.hovered)) {
        return AppColors.splash;
        }
        return AppColors.fillPrimary;
    }),
),
Authors: Nanang Prasetya