fix: update fonts size on game hud (#347)

pull/350/head
arturplaczek 3 years ago committed by GitHub
parent 3465c9f1e7
commit 28606241df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -50,17 +50,19 @@ class _ScoreDisplay extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final l10n = context.l10n; final l10n = context.l10n;
return Column( return FittedBox(
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start,
children: [ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
Text( children: [
l10n.score.toLowerCase(), Text(
style: Theme.of(context).textTheme.subtitle1, l10n.score.toLowerCase(),
), style: Theme.of(context).textTheme.subtitle1,
const _ScoreText(), ),
const RoundCountDisplay(), const _ScoreText(),
], const RoundCountDisplay(),
],
),
); );
} }
} }
@ -72,11 +74,9 @@ class _ScoreText extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final score = context.select((GameBloc bloc) => bloc.state.displayScore); final score = context.select((GameBloc bloc) => bloc.state.displayScore);
return FittedBox( return Text(
child: Text( score.formatScore(),
score.formatScore(), style: Theme.of(context).textTheme.headline1,
style: Theme.of(context).textTheme.headline2,
),
); );
} }
} }

@ -45,7 +45,7 @@ abstract class PinballTextStyle {
); );
static const subtitle1 = TextStyle( static const subtitle1 = TextStyle(
fontSize: 10, fontSize: 12,
fontFamily: _primaryFontFamily, fontFamily: _primaryFontFamily,
package: _fontPackage, package: _fontPackage,
color: PinballColors.yellow, color: PinballColors.yellow,

@ -26,9 +26,9 @@ void main() {
expect(style.color, PinballColors.white); expect(style.color, PinballColors.white);
}); });
test('subtitle1 has fontSize 10 and yellow color', () { test('subtitle1 has fontSize 12 and yellow color', () {
const style = PinballTextStyle.subtitle1; const style = PinballTextStyle.subtitle1;
expect(style.fontSize, 10); expect(style.fontSize, 12);
expect(style.color, PinballColors.yellow); expect(style.color, PinballColors.yellow);
}); });

Loading…
Cancel
Save