FormeCheckbox constructor

FormeCheckbox({
  1. Key? key,
  2. String? name,
  3. bool? initialValue = false,
  4. FormeAsyncValidator<bool?>? asyncValidator,
  5. Duration? asyncValidatorDebounce,
  6. AutovalidateMode? autovalidateMode,
  7. FormeFieldDecorator<bool?>? decorator,
  8. bool enabled = true,
  9. FocusNode? focusNode,
  10. FormeFieldInitialized<bool?>? onInitialized,
  11. FormeFieldSetter<bool?>? onSaved,
  12. FormeFieldStatusChanged<bool?>? onStatusChanged,
  13. int? order,
  14. bool quietlyValidate = false,
  15. bool readOnly = false,
  16. bool requestFocusOnUserInteraction = true,
  17. FormeFieldValidationFilter<bool?>? validationFilter,
  18. FormeValidator<bool?>? validator,
  19. bool tristate = false,
  20. Color? activeColor,
  21. bool autofocus = false,
  22. Color? checkColor,
  23. MaterialStateProperty<Color?>? fillColor,
  24. Color? focusColor,
  25. Color? hoverColor,
  26. MaterialTapTargetSize? materialTapTargetSize,
  27. MouseCursor? mouseCursor,
  28. MaterialStateProperty<Color?>? overlayColor,
  29. OutlinedBorder? shape,
  30. BorderSide? side,
  31. double? splashRadius,
  32. 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();
                  },
          );
        },
      );