ReactiveCheckboxListTile constructor

ReactiveCheckboxListTile({
  1. Key? key,
  2. String? formControlName,
  3. FormControl<bool>? formControl,
  4. Color? activeColor,
  5. Color? checkColor,
  6. Widget? title,
  7. Widget? subtitle,
  8. bool isThreeLine = false,
  9. bool selected = false,
  10. bool? dense,
  11. Widget? secondary,
  12. ListTileControlAffinity controlAffinity = ListTileControlAffinity.platform,
  13. bool autofocus = false,
  14. EdgeInsetsGeometry? contentPadding,
  15. bool tristate = false,
  16. Color? selectedTileColor,
  17. Color? tileColor,
  18. ShapeBorder? shape,
  19. VisualDensity? visualDensity,
  20. FocusNode? focusNode,
  21. bool? enableFeedback,
  22. String? checkboxSemanticLabel,
  23. OutlinedBorder? checkboxShape,
  24. BorderSide? side,
  25. ReactiveFormFieldCallback<bool>? onChanged,
  26. MouseCursor? mouseCursor,
  27. WidgetStateProperty<Color?>? fillColor,
  28. Color? hoverColor,
  29. WidgetStateProperty<Color?>? overlayColor,
  30. double? splashRadius,
  31. MaterialTapTargetSize? materialTapTargetSize,
  32. ValueChanged<bool>? onFocusChange,
  33. double checkboxScaleFactor = 1.0,
  34. ShowErrorsFunction<bool>? showErrors,
})

Create an instance of a ReactiveCheckbox.

Can optionally provide a formControl to bind this widget to a control.

Can optionally provide a formControlName to bind this ReactiveFormField to a FormControl.

Must provide one of the arguments formControl or a formControlName, but not both at the same time.

For documentation about the various parameters, see the CheckboxListTile class and the CheckboxListTile constructor.

Implementation

ReactiveCheckboxListTile({
  super.key,
  super.formControlName,
  super.formControl,
  Color? activeColor,
  Color? checkColor,
  Widget? title,
  Widget? subtitle,
  bool isThreeLine = false,
  bool selected = false,
  bool? dense,
  Widget? secondary,
  ListTileControlAffinity controlAffinity = ListTileControlAffinity.platform,
  bool autofocus = false,
  EdgeInsetsGeometry? contentPadding,
  bool tristate = false,
  Color? selectedTileColor,
  Color? tileColor,
  ShapeBorder? shape,
  VisualDensity? visualDensity,
  super.focusNode,
  bool? enableFeedback,
  String? checkboxSemanticLabel,
  OutlinedBorder? checkboxShape,
  BorderSide? side,
  ReactiveFormFieldCallback<bool>? onChanged,
  MouseCursor? mouseCursor,
  WidgetStateProperty<Color?>? fillColor,
  Color? hoverColor,
  WidgetStateProperty<Color?>? overlayColor,
  double? splashRadius,
  MaterialTapTargetSize? materialTapTargetSize,
  ValueChanged<bool>? onFocusChange,
  double checkboxScaleFactor = 1.0,
  ShowErrorsFunction<bool>? showErrors,
}) : super(
       showErrors:
           showErrors ??
           (control) => control.invalid && (control.dirty || control.touched),
       builder: (field) {
         return CheckboxListTile(
           value: tristate ? field.value : field.value ?? false,
           mouseCursor: mouseCursor,
           fillColor: fillColor,
           hoverColor: hoverColor,
           overlayColor: overlayColor,
           materialTapTargetSize: materialTapTargetSize,
           splashRadius: splashRadius,
           activeColor: activeColor,
           checkColor: checkColor,
           onFocusChange: onFocusChange,
           isError: field.errorText != null,
           title: title,
           subtitle: subtitle,
           isThreeLine: isThreeLine,
           dense: dense,
           secondary: secondary,
           controlAffinity: controlAffinity,
           autofocus: autofocus,
           contentPadding: contentPadding,
           tristate: tristate,
           selectedTileColor: selectedTileColor,
           tileColor: tileColor,
           shape: shape,
           selected: selected,
           visualDensity: visualDensity,
           focusNode: field.focusNode,
           enableFeedback: enableFeedback,
           checkboxSemanticLabel: checkboxSemanticLabel,
           checkboxScaleFactor: checkboxScaleFactor,
           checkboxShape: checkboxShape,
           side: side,
           enabled: field.control.enabled,
           onChanged:
               field.control.enabled
                   ? (value) {
                     field.didChange(value);
                     onChanged?.call(field.control);
                   }
                   : null,
         );
       },
     );