FormeCheckbox constructor

FormeCheckbox({
  1. bool? initialValue,
  2. required String name,
  3. bool readOnly = false,
  4. Key? key,
  5. int? order,
  6. bool quietlyValidate = false,
  7. Duration? asyncValidatorDebounce,
  8. AutovalidateMode? autovalidateMode,
  9. FormeValueChanged<bool?>? onValueChanged,
  10. FormeFocusChanged<bool?>? onFocusChanged,
  11. FormeFieldValidationChanged<bool?>? onValidationChanged,
  12. FormeFieldInitialed<bool?>? onInitialed,
  13. FormeFieldSetter<bool?>? onSaved,
  14. FormeValidator<bool?>? validator,
  15. FormeAsyncValidator<bool?>? asyncValidator,
  16. Color? activeColor,
  17. MouseCursor? mouseCursor,
  18. MaterialStateProperty<Color?>? fillColor,
  19. Color? checkColor,
  20. Color? focusColor,
  21. Color? hoverColor,
  22. MaterialStateProperty<Color?>? overlayColor,
  23. double? splashRadius,
  24. VisualDensity? visualDensity,
  25. MaterialTapTargetSize? materialTapTargetSize,
  26. OutlinedBorder? shape,
  27. bool autofocus = false,
  28. BorderSide? side,
  29. bool tristate = false,
  30. bool requestFocusOnUserInteraction = true,
  31. FormeFieldDecorator<bool>? decorator,
  32. bool registrable = true,
  33. bool enabled = true,
})

Implementation

FormeCheckbox({
  bool? initialValue,
  required String name,
  bool readOnly = false,
  Key? key,
  int? order,
  bool quietlyValidate = false,
  Duration? asyncValidatorDebounce,
  AutovalidateMode? autovalidateMode,
  FormeValueChanged<bool?>? onValueChanged,
  FormeFocusChanged<bool?>? onFocusChanged,
  FormeFieldValidationChanged<bool?>? onValidationChanged,
  FormeFieldInitialed<bool?>? onInitialed,
  FormeFieldSetter<bool?>? onSaved,
  FormeValidator<bool?>? validator,
  FormeAsyncValidator<bool?>? asyncValidator,
  Color? activeColor,
  MouseCursor? mouseCursor,
  MaterialStateProperty<Color?>? fillColor,
  Color? checkColor,
  Color? focusColor,
  Color? hoverColor,
  MaterialStateProperty<Color?>? overlayColor,
  double? splashRadius,
  VisualDensity? visualDensity,
  MaterialTapTargetSize? materialTapTargetSize,
  OutlinedBorder? shape,
  bool autofocus = false,
  BorderSide? side,
  this.tristate = false,
  bool requestFocusOnUserInteraction = true,
  FormeFieldDecorator<bool>? decorator,
  bool registrable = true,
  bool enabled = true,
}) : super(
        enabled: enabled,
        registrable: registrable,
        decorator: decorator,
        requestFocusOnUserInteraction: requestFocusOnUserInteraction,
        order: order,
        quietlyValidate: quietlyValidate,
        asyncValidatorDebounce: asyncValidatorDebounce,
        autovalidateMode: autovalidateMode,
        onValueChanged: onValueChanged,
        onFocusChanged: onFocusChanged,
        onValidationChanged: onValidationChanged,
        onInitialed: onInitialed,
        onSaved: onSaved,
        validator: validator,
        asyncValidator: asyncValidator,
        key: key,
        readOnly: readOnly,
        name: name,
        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,
            onChanged: readOnly
                ? null
                : (value) {
                    state.didChange(value);
                    state.requestFocusOnUserInteraction();
                  },
          );
        },
      );