fillColor property
final
The color that fills the checkbox, in all WidgetStates.
Resolves in the following states:
This example resolves the fillColor based on the current WidgetState
of the Checkbox, providing a different Color when it is
WidgetState.disabled.
link
Checkbox(
value: true,
onChanged: (_){},
fillColor: MaterialStateProperty.resolveWith<Color>((Set<WidgetState> states) {
if (states.contains(WidgetState.disabled)) {
return Colors.orange.withOpacity(.32);
}
return Colors.orange;
})
)
If null, then the value of activeColor is used in the selected state. If that is also null, the value of CheckboxThemeData.fillColor is used. If that is also null, then ThemeData.disabledColor is used in the disabled state, ColorScheme.secondary is used in the selected state, and ThemeData.unselectedWidgetColor is used in the default state.
Implementation
final MaterialStateProperty<Color?>? fillColor;