Flutter listtile height

Flutter ListTile Height

The height of a ListTile in Flutter can be adjusted using the contentPadding property. By default, ListTile has a specific height based on the material design guidelines, but you can customize it to fit your needs.

Example 1:

Let’s say you want to increase the height of a ListTile. You can wrap the ListTile with a Container widget and set the height of the Container according to your desired value:

    
Container(
  height: 80, // Adjust the value as needed
  child: ListTile(
    title: Text('Item 1'),
    subtitle: Text('Subtitle'),
    leading: Icon(Icons.account_circle),
  ),
)
    
  

Example 2:

If you want to decrease the height of a ListTile, you can set the contentPadding property to reduce the vertical space:

    
ListTile(
  title: Text('Item 1'),
  subtitle: Text('Subtitle'),
  leading: Icon(Icons.account_circle),
  contentPadding: EdgeInsets.symmetric(vertical: 4), // Adjust the value as needed
)
    
  

Result:

By customizing the height of a ListTile, you can control how much vertical space it occupies in your app’s layout.

Leave a comment