NextBusSG icon indicating copy to clipboard operation
NextBusSG copied to clipboard

Manually set Expansion Tile height and width

Open ninest opened this issue 4 years ago • 1 comments

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.

ninest avatar Feb 28 '20 17:02 ninest

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

ninest avatar Feb 29 '20 12:02 ninest