ListTile Flutter

ListTile is generally used to populate a ListView in Flutter. ListTile makes populating ListView very simple.

Here we will cover all parameters of ListTile.

title

The title can take any widget. Usually, it will a Text Widget

 ListTile(
                title: Text("Ford"),
              ),

subtitle

The subtitle is the smaller text showing below the title

   ListTile(
                title: Text("Ford"),
                subtitle: Text("Super Car"),
              ),

leading

The leading property is the starting section of the ListTile. You add any widget. But usually, it will be an image or icon.

 ListTile(
                title: Text("Ford"),
                subtitle: Text("Super Car"),
                leading: Icon(Icons.time_to_leave),
              ),

trailing

Setting trailing places a widget at the end of the ListTile.

  ListTile(
                title: Text("Ford"),
                subtitle: Text("Super Car"),
                leading: Icon(Icons.time_to_leave),
                trailing: Icon(Icons.keyboard_arrow_right),
              ),

dense

This parameter makes the text smaller and packs together.

 ListTile(
                title: Text("Ford"),
                subtitle: Text("Super Car"),
                dense: true,
              ),

Read More

How To Install Flutter In Android Studio

Leave a Reply