I am using a Expansion tile, but I do not want to have any trailing space occupied at the end of the widget. Event though i remove the trailing ICON with sized box, still the space for the ICON is occupied, I do not want the entire space for the content rather then the trailing ICON.
Below is my code:
ExpansionTile(
initiallyExpanded: expanded,
trailing: const SizedBox.shrink(),
textColor: Colors.teal,
collapsedTextColor: Colors.teal,
title: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Center(
child: Text(title,
style: const TextStyle(
color: Colors.teal,
)))),
iconColor: Colors.green,
collapsedIconColor: Colors.teal,
children: body)
Below is the image:
As per your desired behavior, you can just use a ListTile:
Note: You might need to wrap the ListTile inside of an Expanded widget if it is within a Row/Column