ListTile class

A single fixed-height row that typically contains some text as well as a leading or trailing icon.

A list tile contains one to three lines of text optionally flanked by icons or other widgets, such as check boxes. The icons (or other widgets) for the tile are defined with the leading and trailing parameters. The first line of text is not optional and is specified with title. The value of subtitle, which is optional, will occupy the space allocated for an additional line of text, or two lines if isThreeLine is true. If dense is true then the overall height of this tile and the size of the DefaultTextStyles that wrap the title and subtitle widget are reduced.

List tiles are always a fixed height (which height depends on how isThreeLine, dense, and subtitle are configured); they do not grow in height based on their contents. If you are looking for a widget that allows for arbitrary layout in a row, consider Row.

List tiles are typically used in ListViews, or arranged in Columns in Drawers and Cards.

Requires one of its ancestors to be a Material widget.

Sample code

Here is a simple tile with an icon and some text.

  leading: const Icon(Icons.event_seat),
  title: const Text('The seat for the narrator'),

Tiles can be much more elaborate. Here is a tile which can be tapped, but which is disabled when the _act variable is not 2. When the tile is tapped, the whole row has an ink splash effect (see InkWell).

int _act = 1;
// ...
  leading: const Icon(Icons.flight_land),
  title: const Text('Trix\'s airplane'),
  subtitle: _act != 2 ? const Text('The airplane is only in Act II.') : null,
  enabled: _act == 2,
  onTap: () { /* react to the tile being tapped */ }

See also:



ListTile({Key key, Widget leading, Widget title, Widget subtitle, Widget trailing, bool isThreeLine: false, bool dense, EdgeInsetsGeometry contentPadding, bool enabled: true, GestureTapCallback onTap, GestureLongPressCallback onLongPress, bool selected: false })
Creates a list tile. [...]


contentPadding EdgeInsetsGeometry
The tile's internal padding. [...]
dense → bool
Whether this list tile is part of a vertically dense list. [...]
enabled → bool
Whether this list tile is interactive. [...]
isThreeLine → bool
Whether this list tile is intended to display three lines of text. [...]
leading Widget
A widget to display before the title. [...]
onLongPress GestureLongPressCallback
Called when the user long-presses on this list tile. [...]
onTap GestureTapCallback
Called when the user taps this list tile. [...]
selected → bool
If this tile is also enabled then icons and text are rendered with the same color. [...]
subtitle Widget
Additional content displayed below the title. [...]
title Widget
The primary content of the list tile. [...]
trailing Widget
A widget to display after the title. [...]
hashCode → int
The hash code for this object. [...]
read-only, inherited
key Key
Controls how one widget replaces another widget in the tree. [...]
final, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited


build(BuildContext context) Widget
Describes the part of the user interface represented by this widget. [...]
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree. [...]
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
toDiagnosticsNode({String name, DiagnosticsTreeStyle style }) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by toStringDeep. [...]
toString({DiagnosticLevel minLevel: DiagnosticLevel.debug }) → String
Returns a string representation of this object.
toStringDeep({String prefixLineOne: '', String prefixOtherLines, DiagnosticLevel minLevel: DiagnosticLevel.debug }) → String
Returns a string representation of this node and its descendants. [...]
toStringShallow({String joiner: ', ', DiagnosticLevel minLevel: DiagnosticLevel.debug }) → String
Returns a one-line detailed description of the object. [...]
toStringShort() → String
A short, textual description of this widget.


operator ==(dynamic other) → bool
The equality operator. [...]

Static Methods

divideTiles({BuildContext context, Iterable<Widget> tiles, Color color }) → Iterable<Widget>
Add a one pixel border in between each tile. If color isn't specified the ThemeData.dividerColor of the context's Theme is used. [...]