By default we have 16 horizontal paddings in ExpansionTile's header, because it is ListTile and it has
/// If null, `EdgeInsets.symmetric(horizontal: 16.0)` is used.
final EdgeInsetsGeometry contentPadding;
So we have spaces on left and right
How to remove them?
Default value is 40 , so to reduce space between leading and title by x pass minLeadingWidth: 40 - x .
It defaults to 8.0 padding on all sides.
You need to implement it in your code respectively: Create a new dart file called expansion_title_demo. dart inside the lib folder. In this screen, we will create a list with the help of a list view builder in which the expansion tile widget will be used and initialize the list data into the expansion tile widget.
The chosen answer is not working fully. In order to get it right you should go :
ListTileTheme(
contentPadding: EdgeInsets.all(0),
dense: true,
horizontalTitleGap: 0.0,
minLeadingWidth: 0,
child: ExpansionTile(...)
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With