ComCheckboxListTile constructor

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

Creates a combination of a list tile and a checkbox.

The checkbox tile itself does not maintain any state. Instead, when the state of the checkbox changes, the widget calls the onChanged callback. Most widgets that use a checkbox will listen for the onChanged callback and rebuild the checkbox tile with a new value to update the visual appearance of the checkbox.

The following arguments are required:

  • value, which determines whether the checkbox is checked. The value can only be null if tristate is true.
  • onChanged, which is called when the value of the checkbox should change. It can be set to null to disable the checkbox.

Implementation

const ComCheckboxListTile({
  super.key,
  required this.value,
  required this.onChanged,
  this.mouseCursor,
  this.activeColor,
  this.fillColor,
  this.checkColor,
  this.hoverColor,
  this.overlayColor,
  this.splashRadius,
  this.materialTapTargetSize,
  this.visualDensity = const VisualDensity(horizontal: -4.0, vertical: -4.0),
  this.offset = const Offset(1, 1),
  this.focusNode,
  this.autofocus = false,
  this.shape,
  this.side,
  this.isError = false,
  this.enabled,
  this.tileColor,
  this.title,
  this.subtitle,
  this.isThreeLine = false,
  this.dense,
  this.secondary,
  this.selected = false,
  this.controlAffinity = ListTileControlAffinity.platform,
  this.contentPadding,
  this.tristate = false,
  this.checkboxShape,
  this.selectedTileColor,
  this.onFocusChange,
  this.enableFeedback,
  this.checkboxSemanticLabel,
})  : _checkboxType = _CheckboxType.material,
      assert(tristate || value != null),
      assert(!isThreeLine || subtitle != null);