NextBusSG
NextBusSG copied to clipboard
Manually set Expansion Tile height and width
I do not know the default vertical and horizontal padding for the ExpansionPanel
widget, so I had to "eyeball" it to make the placeholder loading widget (LoadingBusStopTile
). The values provided for padding look fine when the default font size is 19, but may look weird for different sizes.
Temporary fix found, not perfect. Still involves some hardcoding to get the MRT stations to display in the bus arrival bus stop tiles.
ListTileTheme(
// setting padding value if mrt is there
// THESE VALUES ARE HARDOCDED because
contentPadding: EdgeInsets.only(
left: Values.busStopTileHorizontalPadding,
right: Values.busStopTileHorizontalPadding,
top: widget.mrtStations.isNotEmpty ? Values.busStopTileVerticalPadding /2 : 0,
bottom: widget.mrtStations.isNotEmpty ? Values.busStopTileVerticalPadding /2 : 0,
),
child: ExpansionTile(
...
Reference: https://stackoverflow.com/questions/54714836/how-to-remove-default-padding-from-expansiontiles-header