FormeCheckbox constructor
FormeCheckbox({
- Key? key,
- String? name,
- bool? initialValue = false,
- FormeAsyncValidator<
bool?> ? asyncValidator, - Duration? asyncValidatorDebounce,
- AutovalidateMode? autovalidateMode,
- FormeFieldDecorator<
bool?> ? decorator, - bool enabled = true,
- FocusNode? focusNode,
- FormeFieldInitialized<
bool?> ? onInitialized, - FormeFieldSetter<
bool?> ? onSaved, - FormeFieldStatusChanged<
bool?> ? onStatusChanged, - int? order,
- bool quietlyValidate = false,
- bool readOnly = false,
- bool requestFocusOnUserInteraction = true,
- FormeFieldValidationFilter<
bool?> ? validationFilter, - FormeValidator<
bool?> ? validator, - bool tristate = false,
- Color? activeColor,
- bool autofocus = false,
- Color? checkColor,
- MaterialStateProperty<
Color?> ? fillColor, - Color? focusColor,
- Color? hoverColor,
- MaterialTapTargetSize? materialTapTargetSize,
- MouseCursor? mouseCursor,
- MaterialStateProperty<
Color?> ? overlayColor, - OutlinedBorder? shape,
- BorderSide? side,
- double? splashRadius,
- VisualDensity? visualDensity,
Implementation
FormeCheckbox({
super.key,
super.name,
bool? initialValue = false,
super.asyncValidator,
super.asyncValidatorDebounce,
super.autovalidateMode,
super.decorator,
super.enabled = true,
super.focusNode,
super.onInitialized,
super.onSaved,
super.onStatusChanged,
super.order,
super.quietlyValidate = false,
super.readOnly = false,
super.requestFocusOnUserInteraction = true,
super.validationFilter,
super.validator,
this.tristate = false,
this.activeColor,
this.autofocus = false,
this.checkColor,
this.fillColor,
this.focusColor,
this.hoverColor,
this.materialTapTargetSize,
this.mouseCursor,
this.overlayColor,
this.shape,
this.side,
this.splashRadius,
this.visualDensity,
}) : super.allFields(
initialValue: tristate ? initialValue : initialValue ?? false,
builder: (state) {
final bool readOnly = state.readOnly;
final bool? value = state.value;
return Checkbox(
autofocus: autofocus,
focusNode: state.focusNode,
side: side,
tristate: tristate,
mouseCursor: mouseCursor,
shape: shape,
activeColor: activeColor,
fillColor: fillColor,
checkColor: checkColor,
materialTapTargetSize: materialTapTargetSize,
focusColor: focusColor,
hoverColor: hoverColor,
overlayColor: overlayColor,
splashRadius: splashRadius,
visualDensity: visualDensity,
value: value,
isError: state.errorText != null,
onChanged: readOnly
? null
: (value) {
state.didChange(value);
state.requestFocusOnUserInteraction();
},
);
},
);