Remove space top and bottom ListTile flutter
In your code put property dense: true inside the list tile
ListTile(
dense:true,
contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
title: Text(
'Home',
style: TextStyle(fontSize: 15.0),
),
),
Hope it helps!
You can use the visualDensity
property to reduce the space.
ListTile(
visualDensity: VisualDensity(horizontal: 0, vertical: -4),
title: Text("xyz")
);
The visualDensity
value can be changed from -4.0 to 4.0
. Lower the value, more compact the view.
P.S. This solution is similar to a different question
This question is about the top/bottom
spacing. But the other question is about gap between leading
and title
With ListTile
it is not possible. Some modifications are possible with the help of ListTileTheme
like color and there is also the option of modifying padding but only work for left and right padding. So better is to create your own custom tile as @santosh showed in his answer.
You can also use SizedBox but it can result in tragic output.