How can I reduce the vertical padding between the ExpansionTile children:
Here is the inline widget code:
Expanded(
child: ListView(
padding: EdgeInsets.all(0.0) ,
primary: true,
shrinkWrap: true,
children: <Widget>[
ExpansionTile(
title: Text("Categories"),
children: [
CheckboxListTile(
controlAffinity: ListTileControlAffinity.trailing,
title: Text( "Cars", maxLines: 1, ),
),
CheckboxListTile(
controlAffinity: ListTileControlAffinity.trailing,
title: Text("Veichle", maxLines: 1, ),
),
],
initiallyExpanded: true,
),
],
),
),
By adding A ListTileTheme
before each ExpansionTile
and making dense: true,
it will make Padding more "Reasonable"
Expanded(
child: ListView(
padding: EdgeInsets.all(0.0) ,
primary: true,
shrinkWrap: true,
children: <Widget>[
ListTileTheme(
dense: true,
child: ExpansionTile(
title: Text("Categories"),
children: [
CheckboxListTile(
controlAffinity: ListTileControlAffinity.trailing,
title: Text( "Cars", maxLines: 1, ),
),
CheckboxListTile(
controlAffinity: ListTileControlAffinity.trailing,
title: Text("Veichle", maxLines: 1, ),
),
],
initiallyExpanded: true,
),
),
],
),
)
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