onChanged property

ValueChanged<T?>? onChanged

Called when the user selects this radio button.

The radio button passes value as a parameter to this callback. The radio button does not actually change state until the parent widget rebuilds the radio tile with the new groupValue.

If null, the radio button will be displayed as disabled.

The provided callback will not be invoked if this radio button is already selected.

The callback provided to onChanged should update the state of the parent StatefulWidget using the State.setState method, so that the parent gets rebuilt; for example:

  title: const Text('Lafayette'),
  value: SingingCharacter.lafayette,
  groupValue: _character,
  onChanged: (SingingCharacter? newValue) {
    setState(() {
      _character = newValue;


final ValueChanged<T?>? onChanged;