ListTile constructor Null safety

const ListTile(
  1. {Key? key,
  2. Widget? leading,
  3. Widget? title,
  4. Widget? subtitle,
  5. Widget? trailing,
  6. bool isThreeLine,
  7. bool? dense,
  8. VisualDensity? visualDensity,
  9. ShapeBorder? shape,
  10. EdgeInsetsGeometry? contentPadding,
  11. bool enabled,
  12. GestureTapCallback? onTap,
  13. GestureLongPressCallback? onLongPress,
  14. MouseCursor? mouseCursor,
  15. bool selected,
  16. Color? focusColor,
  17. Color? hoverColor,
  18. FocusNode? focusNode,
  19. bool autofocus,
  20. Color? tileColor,
  21. Color? selectedTileColor,
  22. bool? enableFeedback,
  23. double? horizontalTitleGap,
  24. double? minVerticalPadding,
  25. 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({
  Key? key,
  this.leading,
  this.title,
  this.subtitle,
  this.trailing,
  this.isThreeLine = false,
  this.dense,
  this.visualDensity,
  this.shape,
  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),
     super(key: key);