FormeCheckboxTile constructor

FormeCheckboxTile({
  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. Color? checkColor,
  18. Color? tileColor,
  19. Color? selectedTileColor,
  20. OutlinedBorder? shape,
  21. bool autofocus = false,
  22. bool tristate = false,
  23. bool requestFocusOnUserInteraction = true,
  24. FormeFieldDecorator<bool>? decorator,
  25. bool registrable = true,
  26. Widget? title,
  27. Widget? subtitle,
  28. bool isThreeLine = false,
  29. bool dense = false,
  30. Widget? secondary,
  31. ListTileControlAffinity controlAffinity = ListTileControlAffinity.platform,
  32. EdgeInsets? contentPadding,
  33. bool selected = false,
  34. bool enabled = true,
})

Implementation

FormeCheckboxTile({
  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,
  Color? checkColor,
  Color? tileColor,
  Color? selectedTileColor,
  OutlinedBorder? shape,
  bool autofocus = false,
  this.tristate = false,
  bool requestFocusOnUserInteraction = true,
  FormeFieldDecorator<bool>? decorator,
  bool registrable = true,
  Widget? title,
  Widget? subtitle,
  bool isThreeLine = false,
  bool dense = false,
  Widget? secondary,
  ListTileControlAffinity controlAffinity = ListTileControlAffinity.platform,
  EdgeInsets? contentPadding,
  bool selected = false,
  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 CheckboxListTile(
            selected: selected,
            value: value,
            activeColor: activeColor,
            checkColor: checkColor,
            tileColor: tileColor,
            title: title,
            subtitle: subtitle,
            isThreeLine: isThreeLine,
            dense: dense,
            secondary: secondary,
            controlAffinity: controlAffinity,
            autofocus: autofocus,
            contentPadding: contentPadding,
            tristate: tristate,
            shape: shape,
            selectedTileColor: selectedTileColor,
            onChanged: readOnly
                ? null
                : (value) {
                    state.didChange(value);
                    state.requestFocusOnUserInteraction();
                  },
          );
        },
      );