fillColor property
final
The color used to fill this checkbox.
Resolves in the following states:
This example resolves the fillColor based on the current WidgetState
of the CupertinoCheckbox, providing a different Color when it is
WidgetState.disabled.
link
CupertinoCheckbox(
value: true,
onChanged: (_){},
fillColor: WidgetStateProperty.resolveWith<Color>((Set<WidgetState> states) {
if (states.contains(WidgetState.disabled)) {
return Colors.orange.withOpacity(.32);
}
return Colors.orange;
})
)
If fillColor resolves to null for the requested state, then the fill color falls back to activeColor if the state includes WidgetState.selected, CupertinoColors.white at 50% opacity if checkbox is disabled, and CupertinoColors.white otherwise.
Implementation
final WidgetStateProperty<Color?>? fillColor;