fillColor property
The color that fills the checkbox, in all WidgetStates.
Resolves in the following states:
{@tool snippet}
This example resolves the fillColor based on the current WidgetState
of the Checkbox, providing a different Color when it is
WidgetState.disabled.
Checkbox(
value: true,
onChanged: (_){},
fillColor: WidgetStateProperty.resolveWith<Color>((Set<WidgetState> states) {
if (states.contains(WidgetState.disabled)) {
return Colors.orange.withOpacity(.32);
}
return Colors.orange;
})
)
{@end-tool}
如果指定,则覆盖 TxRadio.fillColor 的默认值。
Implementation
final MaterialStateProperty<Color?>? fillColor;