ListTile constructor Null safety

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. EdgeInsetsGeometry? contentPadding,
  15. bool enabled = true,
  16. GestureTapCallback? onTap,
  17. GestureLongPressCallback? onLongPress,
  18. MouseCursor? mouseCursor,
  19. bool selected = false,
  20. Color? focusColor,
  21. Color? hoverColor,
  22. FocusNode? focusNode,
  23. bool autofocus = false,
  24. Color? tileColor,
  25. Color? selectedTileColor,
  26. bool? enableFeedback,
  27. double? horizontalTitleGap,
  28. double? minVerticalPadding,
  29. double? minLeadingWidth}
)

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.contentPadding,
  this.enabled = true,
  this.onTap,
  this.onLongPress,
  this.mouseCursor,
  this.selected = false,
  this.focusColor,
  this.hoverColor,
  this.focusNode,
  this.autofocus = false,
  this.tileColor,
  this.selectedTileColor,
  this.enableFeedback,
  this.horizontalTitleGap,
  this.minVerticalPadding,
  this.minLeadingWidth,
}) : assert(isThreeLine != null),
     assert(enabled != null),
     assert(selected != null),
     assert(autofocus != null),
     assert(!isThreeLine || subtitle != null);