ZetaCheckbox constructor
- bool value = false,
- String? label,
- ValueChanged<
bool> ? onChanged, - bool? rounded,
- bool useIndeterminate = false,
- FocusNode? focusNode,
- String? semanticLabel,
- FormFieldValidator<
bool> ? validator, - AutovalidateMode? autovalidateMode,
- String? restorationId,
- Key? key,
Constructs a ZetaCheckbox.
Implementation
ZetaCheckbox({
this.value = false,
this.label,
this.onChanged,
this.rounded,
this.useIndeterminate = false,
this.focusNode,
this.semanticLabel,
super.validator,
super.autovalidateMode,
super.restorationId,
super.key,
}) : super(
initialValue: value,
enabled: onChanged != null,
builder: (field) {
return ZetaInternalCheckbox(
label: label,
onChanged: (changedValue) {
field.didChange(changedValue);
onChanged?.call(changedValue!);
},
rounded: rounded,
useIndeterminate: useIndeterminate,
value: value,
error: !field.isValid,
disabled: onChanged == null,
focusNode: focusNode,
semanticLabel: semanticLabel,
);
},
);