I am want to remove the space between in default leading icon and title in the expansion in flutter
Image from reference:
I saw a answer on this question: Flutter expansionTile title padding but the answer doesn't work: tilePadding: EdgeInsets.zero,
Note: I want the icon and title as a single unit and comes under flex: 5
My Code:
ExpansionTile(
controlAffinity: ListTileControlAffinity.leading,
initiallyExpanded: false,
tilePadding: EdgeInsets.zero,
title: Row(
children: [
Expanded(
flex: 5,
child: Text(
controller.reportData[index]['customer'],
textAlign: TextAlign.left,
overflow: TextOverflow.ellipsis,
style: context.bodyLarge.copyWith(
fontWeight: FontWeight.normal,
),
),
),
.....
],
),
),
Set a listTileTheme in your MaterialApp configuration with horizontalTitleGap to 0.0.
Or just wrap your widgets inside a ListTileTheme widget with horizontalTitleGap to 0.0.