fillColor property Null safety

MaterialStateProperty<Color?>? fillColor
final

The color that fills the radio button, in all MaterialStates.

Resolves in the following states:

This example resolves the fillColor based on the current MaterialState of the Radio, providing a different Color when it is MaterialState.disabled.
Radio<int>(
  value: 1,
  groupValue: 1,
  onChanged: (_){},
  fillColor: MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) {
    if (states.contains(MaterialState.disabled)) {
      return Colors.orange.withOpacity(.32);
    }
    return Colors.orange;
  })
)

If specified, overrides the default value of Radio.fillColor. The default value is the value of ThemeData.disabledColor in the disabled state, ThemeData.toggleableActiveColor in the selected state, and ThemeData.unselectedWidgetColor in the default state.

Implementation

final MaterialStateProperty<Color?>? fillColor;