CheckboxThemeData.standard constructor
CheckboxThemeData.standard(
- FluentThemeData theme
Implementation
factory CheckboxThemeData.standard(FluentThemeData theme) {
final BorderRadiusGeometry radius = BorderRadius.circular(6.0);
return CheckboxThemeData(
foregroundColor: ButtonState.resolveWith((states) {
return states.isDisabled ? theme.resources.textFillColorDisabled : null;
}),
checkedDecoration: ButtonState.resolveWith(
(states) => BoxDecoration(
borderRadius: radius,
border: Border.all(
color: states.isDisabled
? theme.resources.controlStrongStrokeColorDisabled
: ButtonThemeData.checkedInputColor(theme, states),
),
color: ButtonThemeData.checkedInputColor(theme, states),
),
),
uncheckedDecoration: ButtonState.resolveWith(
(states) => BoxDecoration(
border: Border.all(
color: states.isDisabled || states.isPressing
? theme.resources.controlStrongStrokeColorDisabled
: theme.resources.controlStrongStrokeColorDefault,
),
color: ButtonState.forStates(
states,
disabled: theme.resources.controlAltFillColorDisabled,
pressed: theme.resources.controlAltFillColorQuarternary,
hovering: theme.resources.controlAltFillColorTertiary,
none: theme.resources.controlAltFillColorSecondary,
),
borderRadius: radius,
),
),
thirdstateDecoration: ButtonState.resolveWith(
(states) => BoxDecoration(
borderRadius: radius,
border: Border.all(
color: states.isDisabled
? theme.resources.controlStrongStrokeColorDisabled
: ButtonThemeData.checkedInputColor(theme, states),
),
color: ButtonThemeData.checkedInputColor(theme, states),
),
),
checkedIconColor: ButtonState.resolveWith((states) {
return FilledButton.foregroundColor(theme, states);
}),
uncheckedIconColor: ButtonState.all(Colors.transparent),
icon: FluentIcons.check_mark,
);
}