ListTile constructor

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

Creates a list tile.

If isThreeLine is true, then subtitle must not be null.

Requires one of its ancestors to be a Material widget.

Implementation

const ListTile({
  super.key,
  this.leading,
  this.title,
  this.subtitle,
  this.trailing,
  this.isThreeLine = false,
  this.dense,
  this.visualDensity,
  this.shape,
  this.style,
  this.selectedColor,
  this.iconColor,
  this.textColor,
  this.titleTextStyle,
  this.subtitleTextStyle,
  this.leadingAndTrailingTextStyle,
  this.contentPadding,
  this.enabled = true,
  this.onTap,
  this.onLongPress,
  this.onFocusChange,
  this.mouseCursor,
  this.selected = false,
  this.focusColor,
  this.hoverColor,
  this.splashColor,
  this.focusNode,
  this.autofocus = false,
  this.tileColor,
  this.selectedTileColor,
  this.enableFeedback,
  this.horizontalTitleGap,
  this.minVerticalPadding,
  this.minLeadingWidth,
  this.minTileHeight,
  this.titleAlignment,
}) : assert(!isThreeLine || subtitle != null);