re-worked the game details page Score section
This commit is contained in:
@@ -34,10 +34,11 @@ class GameDetailsHeader extends StatelessWidget {
|
|||||||
|
|
||||||
Text _pastGameScore(
|
Text _pastGameScore(
|
||||||
String homeAway, String winLoss, String uncc, String opponent) {
|
String homeAway, String winLoss, String uncc, String opponent) {
|
||||||
|
double fontsize = 25;
|
||||||
if (homeAway == "H" || homeAway == "T") {
|
if (homeAway == "H" || homeAway == "T") {
|
||||||
return (Text('$uncc - $opponent'));
|
return (Text('$uncc - $opponent',style: TextStyle(fontSize: fontsize)));
|
||||||
} else {
|
} 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,
|
height: size.height / 7,
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Colors.black26,
|
color: Colors.black26,
|
||||||
width: size.width,
|
child: Row(
|
||||||
child: Center(
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
child: ListTile(
|
mainAxisSize: MainAxisSize.min,
|
||||||
leading: SizedBox(
|
children: <Widget>[
|
||||||
width: size.width / 3,
|
Expanded(
|
||||||
child: _homeAwayImageOrder(gameCard.location_indicator,
|
child: _homeAwayImageOrder(
|
||||||
gameCard.image, true, context)),
|
gameCard.location_indicator,
|
||||||
title: FittedBox(
|
gameCard.image,
|
||||||
fit: BoxFit.contain,
|
true, context),
|
||||||
child: Wrap(
|
),
|
||||||
|
Container(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
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
|
||||||
else
|
Text(
|
||||||
_pastGameScore(
|
'${_months[gameCard.date.month]} ${gameCard.date.day}',
|
||||||
gameCard.location_indicator,
|
style: TextStyle(fontSize: 25),
|
||||||
gameCard.status,
|
)
|
||||||
gameCard.team_score,
|
else
|
||||||
gameCard.opponent_score,
|
_pastGameScore(
|
||||||
),
|
gameCard.location_indicator,
|
||||||
],
|
gameCard.status,
|
||||||
)),
|
gameCard.team_score,
|
||||||
subtitle: FittedBox(
|
gameCard.opponent_score,),
|
||||||
fit: BoxFit.contain,
|
],
|
||||||
child: Wrap(
|
),
|
||||||
children: <Widget>[
|
Wrap(
|
||||||
if (gameCard.status != null) // no game yet
|
children: <Widget>[
|
||||||
Text(
|
if (gameCard.status != null) // no game yet
|
||||||
'${_months[gameCard.date.month]} ${gameCard.date.day}',
|
Text(
|
||||||
textAlign: TextAlign.center,
|
'${_months[gameCard.date.month]} ${gameCard.date.day}', textAlign: TextAlign.center,
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
Text(
|
Text('${gameCard.date.hour}:${gameCard.date.minute} PM'),
|
||||||
'${gameCard.date.hour}:${gameCard.date.minute} PM'),
|
],
|
||||||
],
|
)
|
||||||
)),
|
]
|
||||||
trailing: SizedBox(
|
),
|
||||||
width: size.width / 3,
|
),
|
||||||
child: _homeAwayImageOrder(gameCard.location_indicator,
|
Expanded(
|
||||||
gameCard.image, false, context)),
|
child: _homeAwayImageOrder(
|
||||||
),
|
gameCard.location_indicator,
|
||||||
)),
|
gameCard.image,
|
||||||
|
false, context),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user