re-added route to game details page
This commit is contained in:
@@ -132,7 +132,6 @@ class GameCard extends StatelessWidget {
|
|||||||
borderRadius: BorderRadius.circular(2),
|
borderRadius: BorderRadius.circular(2),
|
||||||
);
|
);
|
||||||
var logoWidth = 4.5;
|
var logoWidth = 4.5;
|
||||||
var body = buildCard(ctx, logoWidth, _months);
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: widthIn(ctx),
|
width: widthIn(ctx),
|
||||||
child: Card(
|
child: Card(
|
||||||
@@ -140,7 +139,7 @@ class GameCard extends StatelessWidget {
|
|||||||
clipBehavior: Clip.antiAliasWithSaveLayer,
|
clipBehavior: Clip.antiAliasWithSaveLayer,
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: decoration,
|
decoration: decoration,
|
||||||
child: body,
|
child: buildCard(ctx, logoWidth, _months),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -148,58 +147,60 @@ class GameCard extends StatelessWidget {
|
|||||||
|
|
||||||
Widget buildCard(BuildContext ctx, double logoWidth, Map<int, String> _months) {
|
Widget buildCard(BuildContext ctx, double logoWidth, Map<int, String> _months) {
|
||||||
|
|
||||||
return Container(
|
return GestureDetector(
|
||||||
color: Colors.black12,
|
child: Container(
|
||||||
child: Row(
|
color: Colors.black12,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
children: <Widget>[
|
mainAxisSize: MainAxisSize.min,
|
||||||
Expanded(
|
children: <Widget>[
|
||||||
child: _homeAwayImageOrder(
|
Expanded(
|
||||||
gameCard.location_indicator,
|
child: _homeAwayImageOrder(
|
||||||
gameCard.image,
|
gameCard.location_indicator,
|
||||||
true, ctx),
|
gameCard.image,
|
||||||
),
|
true, ctx),
|
||||||
Container(
|
),
|
||||||
child: Column(
|
Container(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
child: Column(
|
||||||
children: <Widget>[
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
Wrap(
|
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
if (gameCard.status == null) // no game yet
|
Wrap(
|
||||||
Text(
|
children: <Widget>[
|
||||||
'${_months[gameCard.date.month]} ${gameCard.date.day}'
|
if (gameCard.status == null) // no game yet
|
||||||
)
|
Text(
|
||||||
else
|
'${_months[gameCard.date.month]} ${gameCard.date.day}'
|
||||||
_pastGameScore(
|
)
|
||||||
gameCard.location_indicator,
|
else
|
||||||
gameCard.status,
|
_pastGameScore(
|
||||||
gameCard.team_score,
|
gameCard.location_indicator,
|
||||||
gameCard.opponent_score,),
|
gameCard.status,
|
||||||
],
|
gameCard.team_score,
|
||||||
|
gameCard.opponent_score,),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Wrap(
|
||||||
|
children: <Widget>[
|
||||||
|
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: <Widget>[
|
Expanded(
|
||||||
if (gameCard.status != null) // no game yet
|
child: _homeAwayImageOrder(
|
||||||
Text(
|
gameCard.location_indicator,
|
||||||
'${_months[gameCard.date.month]} ${gameCard.date.day}', textAlign: TextAlign.center,
|
gameCard.image,
|
||||||
)
|
false, ctx),
|
||||||
else
|
)
|
||||||
Text('${gameCard.date.hour}:${gameCard.date.minute} PM'),
|
],
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
]
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
Expanded(
|
),
|
||||||
child: _homeAwayImageOrder(
|
onTap: () => Navigator.pushNamed(ctx, '/Details', arguments: gameCard),
|
||||||
gameCard.location_indicator,
|
|
||||||
gameCard.image,
|
|
||||||
false, ctx),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user