diff --git a/lib/screens/sport_schedule.dart b/lib/screens/sport_schedule.dart index 2e3fe92..42bcfea 100644 --- a/lib/screens/sport_schedule.dart +++ b/lib/screens/sport_schedule.dart @@ -132,7 +132,6 @@ class GameCard extends StatelessWidget { borderRadius: BorderRadius.circular(2), ); var logoWidth = 4.5; - var body = buildCard(ctx, logoWidth, _months); return SizedBox( width: widthIn(ctx), child: Card( @@ -140,7 +139,7 @@ class GameCard extends StatelessWidget { clipBehavior: Clip.antiAliasWithSaveLayer, child: Container( decoration: decoration, - child: body, + child: buildCard(ctx, logoWidth, _months), ), ), ); @@ -148,58 +147,60 @@ class GameCard extends StatelessWidget { Widget buildCard(BuildContext ctx, double logoWidth, Map _months) { - return Container( - color: Colors.black12, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - mainAxisSize: MainAxisSize.min, - children: [ - Expanded( - child: _homeAwayImageOrder( - gameCard.location_indicator, - gameCard.image, - true, ctx), - ), - Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Wrap( + return GestureDetector( + child: Container( + color: Colors.black12, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisSize: MainAxisSize.min, + children: [ + Expanded( + child: _homeAwayImageOrder( + gameCard.location_indicator, + gameCard.image, + true, ctx), + ), + 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,), - ], + Wrap( + 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,), + ], + ), + 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'), + ], + ) + ] ), - 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, ctx), + ) + ], ), - Expanded( - child: _homeAwayImageOrder( - gameCard.location_indicator, - gameCard.image, - false, ctx), - ) - ], - ), + ), + onTap: () => Navigator.pushNamed(ctx, '/Details', arguments: gameCard), ); } }