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,7 +50,8 @@ class _ScoreDisplay extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final l10n = context.l10n; final l10n = context.l10n;
return Column( return FittedBox(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
@ -61,6 +62,7 @@ class _ScoreDisplay extends StatelessWidget {
const _ScoreText(), const _ScoreText(),
const RoundCountDisplay(), 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.headline2, style: Theme.of(context).textTheme.headline1,
),
); );
} }
} }

@ -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