CustomListTile constructor
const
CustomListTile({
- Key? key,
- Widget? leading,
- Widget? title,
- Widget? subtitle,
- Widget? trailing,
- bool? dense,
- VisualDensity? visualDensity,
- ShapeBorder? shape,
- ListTileStyle? style,
- Color? selectedColor,
- Color? iconColor,
- Color? textColor,
- TextStyle? titleTextStyle,
- TextStyle? subtitleTextStyle,
- TextStyle? leadingAndTrailingTextStyle,
- EdgeInsetsGeometry? contentPadding,
- GestureTapCallback? onTap,
- GestureLongPressCallback? onLongPress,
- ValueChanged<
bool> ? onFocusChange, - MouseCursor? mouseCursor,
- Color? focusColor,
- Color? hoverColor,
- Color? splashColor,
- FocusNode? focusNode,
- Color? tileColor,
- Color? selectedTileColor,
- bool? enableFeedback,
- double? horizontalTitleGap,
- double? minVerticalPadding,
- double? minLeadingWidth,
- ListTileTitleAlignment? titleAlignment,
- bool isThreeLine = false,
- bool selected = false,
- bool autofocus = false,
- String? titleText,
- bool? isRequired,
- String? subtitleText,
- Widget? additionalInfo,
- String? additionalInfoText,
- String? trailingText,
- 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');