CustomCheckboxListTile constructor

const CustomCheckboxListTile({
  1. required bool? value,
  2. required ValueChanged<bool?>? onChanged,
  3. Key? key,
  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,
  13. FocusNode? focusNode,
  14. bool autofocus = false,
  15. ShapeBorder? shape,
  16. BorderSide? side,
  17. bool isError = false,
  18. bool? enabled,
  19. Color? tileColor,
  20. Widget? title,
  21. Widget? subtitle,
  22. bool isThreeLine = false,
  23. bool? dense,
  24. Widget? secondary,
  25. bool selected = false,
  26. EdgeInsetsGeometry? contentPadding,
  27. bool tristate = false,
  28. OutlinedBorder? checkboxShape,
  29. Color? selectedTileColor,
  30. ValueChanged<bool>? onFocusChange,
  31. bool? enableFeedback,
  32. String? checkboxSemanticLabel,
  33. ListTileControlAffinity controlAffinity = ListTileControlAffinity.leading,
  34. String? titleText,
  35. bool? isRequired,
})

CheckboxListTile 自适应复选框列表项组件

Implementation

const CustomCheckboxListTile({
  required this.value,
  required this.onChanged,
  super.key,
  this.mouseCursor,
  this.activeColor,
  this.fillColor,
  this.checkColor,
  this.hoverColor,
  this.overlayColor,
  this.splashRadius,
  this.materialTapTargetSize,
  this.visualDensity,
  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.contentPadding,
  this.tristate = false,
  this.checkboxShape,
  this.selectedTileColor,
  this.onFocusChange,
  this.enableFeedback,
  this.checkboxSemanticLabel,
  // -------------------------------------------------------------------------------------------- > Custom
  this.controlAffinity = ListTileControlAffinity.leading,
  this.titleText,
  this.isRequired,
}) : assert(
        (title != null) != (titleText != null),
        '必须设置 title 或 titleText 其中一个参数',
      );