Creating elegant content lists
We briefly learned about ListView
in Chapter 5, Building Your User Interface through Widgets. When we tested out ListView
, we put relatively basic widgets into ListView
, but there is a widget that is specially designed for lists, ListTile
.
ListTile
simply creates an elegant structure for you to put your display widgets into, be they icons, text, or images. You can emulate the structure of ListTile
through the widgets we have seen before, but abstracting away structure and the boilerplate code required to create it allows you to focus on the core value of your app.
Let’s look at an example of ListTile
:
ListTile( title: Text("Teesside"), subtitle: Text("The home of the Lemon Top ice cream"), leading: Icon(Icons.location_on), onTap: () {...}, trailing: IconButton( icon: Icon(Icons.thumb_up), onPressed: () {...},...