From 8d2477f3e7e6342649b12406a9559fea755d315d Mon Sep 17 00:00:00 2001 From: Carlos Lopez-Rosario Date: Sat, 2 May 2020 19:03:09 -0400 Subject: [PATCH] re-worked the game details page Score section --- lib/models/game_details.dart | 97 ++++++++++++++++++++---------------- 1 file changed, 53 insertions(+), 44 deletions(-) diff --git a/lib/models/game_details.dart b/lib/models/game_details.dart index 206e5d3..fa5c1f5 100644 --- a/lib/models/game_details.dart +++ b/lib/models/game_details.dart @@ -34,10 +34,11 @@ class GameDetailsHeader extends StatelessWidget { Text _pastGameScore( String homeAway, String winLoss, String uncc, String opponent) { + double fontsize = 25; if (homeAway == "H" || homeAway == "T") { - return (Text('$uncc - $opponent')); + return (Text('$uncc - $opponent',style: TextStyle(fontSize: fontsize))); } else { - return (Text('$opponent - $uncc')); + return (Text('$opponent - $uncc',style: TextStyle(fontSize: fontsize))); } } @@ -75,49 +76,57 @@ class GameDetailsHeader extends StatelessWidget { height: size.height / 7, child: Container( color: Colors.black26, - width: size.width, - child: Center( - child: ListTile( - leading: SizedBox( - width: size.width / 3, - child: _homeAwayImageOrder(gameCard.location_indicator, - gameCard.image, true, context)), - title: FittedBox( - fit: BoxFit.contain, - child: Wrap( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisSize: MainAxisSize.min, + children: [ + Expanded( + child: _homeAwayImageOrder( + gameCard.location_indicator, + gameCard.image, + true, context), + ), + Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, children: [ - if (gameCard.status == null) // no game yet - Text( - '${_months[gameCard.date.month]} ${gameCard.date.day}') - else - _pastGameScore( - gameCard.location_indicator, - gameCard.status, - gameCard.team_score, - gameCard.opponent_score, - ), - ], - )), - subtitle: FittedBox( - fit: BoxFit.contain, - child: Wrap( - children: [ - if (gameCard.status != null) // no game yet - Text( - '${_months[gameCard.date.month]} ${gameCard.date.day}', - textAlign: TextAlign.center, - ) - else - Text( - '${gameCard.date.hour}:${gameCard.date.minute} PM'), - ], - )), - trailing: SizedBox( - width: size.width / 3, - child: _homeAwayImageOrder(gameCard.location_indicator, - gameCard.image, false, context)), - ), - )), + Wrap( + children: [ + if (gameCard.status == null) // no game yet + Text( + '${_months[gameCard.date.month]} ${gameCard.date.day}', + style: TextStyle(fontSize: 25), + ) + else + _pastGameScore( + gameCard.location_indicator, + gameCard.status, + gameCard.team_score, + gameCard.opponent_score,), + ], + ), + Wrap( + children: [ + if (gameCard.status != null) // no game yet + Text( + '${_months[gameCard.date.month]} ${gameCard.date.day}', textAlign: TextAlign.center, + ) + else + Text('${gameCard.date.hour}:${gameCard.date.minute} PM'), + ], + ) + ] + ), + ), + Expanded( + child: _homeAwayImageOrder( + gameCard.location_indicator, + gameCard.image, + false, context), + ) + ], + ), + ) ); } }