From 1b60988f09070d37febb34df74e6dc7b62e7d1ea Mon Sep 17 00:00:00 2001 From: Aayan <50059339+Calamity210@users.noreply.github.com> Date: Tue, 22 Sep 2020 19:52:04 -0400 Subject: [PATCH] List tile docs (#65584) --- .../flutter/lib/src/material/list_tile.dart | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/packages/flutter/lib/src/material/list_tile.dart b/packages/flutter/lib/src/material/list_tile.dart index 835963ffb7..bb60ee0827 100644 --- a/packages/flutter/lib/src/material/list_tile.dart +++ b/packages/flutter/lib/src/material/list_tile.dart @@ -291,6 +291,31 @@ enum ListTileControlAffinity { /// {@end-tool} /// {@tool snippet} /// +/// To use a [ListTile] within a [Row], it needs to be wrapped in an +/// [Expanded] widget. [ListTile] requires fixed width constraints, +/// whereas a [Row] does not constrain its children. +/// +/// ```dart +/// Row( +/// children: const [ +/// Expanded( +/// child: ListTile( +/// leading: FlutterLogo(), +/// title: Text('These ListTiles are expanded '), +/// ), +/// ), +/// Expanded( +/// child: ListTile( +/// trailing: FlutterLogo(), +/// title: Text('to fill the available space.'), +/// ), +/// ), +/// ], +/// ) +/// ``` +/// {@end-tool} +/// {@tool snippet} +/// /// 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]).