Flutter expansionTile title padding

1,915

Please try below snipppet

ExpansionTile(title: Row(children: [
  // Icon View,
  // SizedBox of desired width,
  // Text View
  ]),
  children:  ... ,)

If you want to remove padding out side your view Set ExpantionTile tile padding to zero

ExpansionTile(tilePadding: EdgeInsets.zero, 
     title: Row(children: [
  // Icon View,
  // SizedBox of desired width,
  // Text View
  ]),
  children:  ... ,)
Share:
1,915
Mr. ZeroOne
Author by

Mr. ZeroOne

Updated on December 25, 2022

Comments

  • Mr. ZeroOne
    Mr. ZeroOne over 1 year

    How we can remove space between leading and title in Flutter ExpansionTile? enter image description here

    • pskink
      pskink over 3 years
      tried wrapping leading with SizedBox / ConstrainedBox?
    • Mr. ZeroOne
      Mr. ZeroOne over 3 years
      Yes. not worked.
    • pskink
      pskink over 3 years
      seems you cannot make it smaller than _minLeadingWidth
  • petras J
    petras J over 2 years
    TilePadding: EdgeInsets.zero is a working solution. Thank you