ListTile

The ListTile widget contains a Title, Subtitle, Leading Icon, and Trailing Icon. The ListTile widget is typically used to populate a ListView.

For example, you can use the ListTile to show a list of To Do items or emails.

Add a ListTile to Your Project

Here's an example of how you can use a ListTile widget in your project:

  1. First, drag the ListView widget from the Layout Elements tab (in the Widget Panel) or add it directly from the widget tree.

  2. Drag the ListTile widget from the Base Elements tab and drop it inside the ListView.

  3. Select ListTile from the widget tree or from the canvas area.

  4. Move to the Property Editor (on the right side of your screen) and scroll down to the Title section.

  5. Change the Text property to Email.

  6. Scroll down below and find the Subtitle section. Change the property to the From:xyz.

At this point, you have one item added to the list. To fill the ListView with more items simply copy-paste the ListTile widget.

To copy-paste the ListTile widget:

  1. Select the ListTile widget.

  2. Right-click on it and select Copy. You can also use the keyboard shortcut Ctrl+C or Command+C.

  3. Select the ListView widget.

  4. Right-click on it and select Paste. You can also use the keyboard shortcut Ctrl+V or Command+V.

After adding a number of items, the list created using ListTile looks like this:

Making The ListTile Slidable

You may want the ListTile widget to reveal a list of actions that can be taken on a ListTile when a user swipes right. Using the Slidable properties you can achieve this behavior.

To make the ListTile slidable:

  1. Select ListTile from the widget tree or from the canvas area.

  2. Move to the Property Editor (on the right side of your screen) and scroll down to the Slidable Properties section.

  3. Checkmark the Slidable property (click on it).

Learn more about SlidableListTile here.

Changing the Properties

The Properties Panel can be used to customize the appearance and behavior of your widget.

Add Padding

Here are the instructions on how to add padding.

Styling The ListTile

Using various properties under the Style Properties section, you can customize the ListTile as per your design.

Here are the instructions on styling the ListTile.

Customizing The Title

Here are the instructions on customizing the title.

Customizing The Subtitle

Here are the instructions on customizing the subtitle.

Add A Leading Icon

The Leading Icon appears at the start (left side) of the ListTile.

Here are the instructions on adding a leading icon.

Customize The Trailing Icon

The Trailing Icon appears at the end (far right side) of the ListTile. By default, the trailing icon is an arrow.

Here's an example of how you can customize the trailing icon:

  1. Select ListTile from the widget tree or from the canvas area.

  2. Move to the Property Editor (on the right side of your screen) and scroll down to the Trailing Icon section.

  3. Click on the Trailing Icon button, search for a new icon and select the icon you want to use.

  4. Set the Icon Size by entering the value in the Icon Size property.

  5. To change the color, find the Icon Color property, click on the box next to Unset, select the color, and then click Use Selected Color. Or click on Unset and enter a Hex Code directly. You can also choose the color by clicking on the Palette and Simple button.

Set color dynamically

See how to set a color from variable to any color property of this widget.

Adding Action

To perform any action on click of the ListTile, add an Action in FlutterFlow. You can find the instructions on adding the Action here.

Showing Firestore Data

To show the data retrieved from your Firestore collection and document into the ListTile widget, ensure you:

  1. Completed all steps in the Firebase Setup section for your project.

  2. Retrieved Data from either collection or document.

  3. Finally, to show data into the ListTile widget, follow the steps here.

Show/Hide ListTile

Please find the instructions to show/hide the widget here

Last updated