CustomListTile constructor

const CustomListTile({
  1. Key? key,
  2. Widget? leading,
  3. Widget? title,
  4. Widget? subtitle,
  5. Widget? trailing,
  6. bool? dense,
  7. VisualDensity? visualDensity,
  8. ShapeBorder? shape,
  9. ListTileStyle? style,
  10. Color? selectedColor,
  11. Color? iconColor,
  12. Color? textColor,
  13. TextStyle? titleTextStyle,
  14. TextStyle? subtitleTextStyle,
  15. TextStyle? leadingAndTrailingTextStyle,
  16. EdgeInsetsGeometry? contentPadding,
  17. GestureTapCallback? onTap,
  18. GestureLongPressCallback? onLongPress,
  19. ValueChanged<bool>? onFocusChange,
  20. MouseCursor? mouseCursor,
  21. Color? focusColor,
  22. Color? hoverColor,
  23. Color? splashColor,
  24. FocusNode? focusNode,
  25. Color? tileColor,
  26. Color? selectedTileColor,
  27. bool? enableFeedback,
  28. double? horizontalTitleGap,
  29. double? minVerticalPadding,
  30. double? minLeadingWidth,
  31. ListTileTitleAlignment? titleAlignment,
  32. bool isThreeLine = false,
  33. bool selected = false,
  34. bool autofocus = false,
  35. String? titleText,
  36. bool? isRequired,
  37. String? subtitleText,
  38. Widget? additionalInfo,
  39. String? additionalInfoText,
  40. String? trailingText,
  41. bool? card = false,
})

ListTile 列表项组件

Implementation

const CustomListTile({
  super.key,
  this.leading,
  this.title,
  this.subtitle,
  this.trailing,
  this.dense,
  this.visualDensity,
  this.shape,
  this.style,
  this.selectedColor,
  this.iconColor,
  this.textColor,
  this.titleTextStyle,
  this.subtitleTextStyle,
  this.leadingAndTrailingTextStyle,
  this.contentPadding,
  this.onTap,
  this.onLongPress,
  this.onFocusChange,
  this.mouseCursor,
  this.focusColor,
  this.hoverColor,
  this.splashColor,
  this.focusNode,
  this.tileColor,
  this.selectedTileColor,
  this.enableFeedback,
  this.horizontalTitleGap,
  this.minVerticalPadding,
  this.minLeadingWidth,
  this.titleAlignment,
  this.isThreeLine = false,
  this.selected = false,
  this.autofocus = false,
  this.titleText,
  this.isRequired,
  this.subtitleText,
  this.additionalInfo,
  this.additionalInfoText,
  this.trailingText,
  this.card = false,
})  : assert(
        (title == null && titleText == null && isRequired == null) ||
            ((title != null || titleText != null || isRequired != null) &&
                !(title != null && (titleText != null || isRequired != null))),
        '不能同时指定 title 与 titleText 、 isRequired',
      ),
      assert(!(subtitle != null && subtitleText != null), '不能同时设置 subtitle 和 subtitleText');