diff --git a/lib/app/view/app.dart b/lib/app/view/app.dart index 97cfec9b..b6b4c897 100644 --- a/lib/app/view/app.dart +++ b/lib/app/view/app.dart @@ -15,6 +15,7 @@ import 'package:pinball/game/game.dart'; import 'package:pinball/l10n/l10n.dart'; import 'package:pinball/select_character/select_character.dart'; import 'package:pinball_audio/pinball_audio.dart'; +import 'package:pinball_ui/pinball_ui.dart'; class App extends StatelessWidget { const App({ @@ -37,14 +38,15 @@ class App extends StatelessWidget { ], child: BlocProvider( create: (context) => CharacterThemeCubit(), - child: const MaterialApp( + child: MaterialApp( title: 'I/O Pinball', - localizationsDelegates: [ + theme: PinballTheme.standard, + localizationsDelegates: const [ AppLocalizations.delegate, GlobalMaterialLocalizations.delegate, ], supportedLocales: AppLocalizations.supportedLocales, - home: PinballGamePage(), + home: const PinballGamePage(), ), ), ); diff --git a/lib/footer/footer.dart b/lib/footer/footer.dart index 711d1ba8..df3dbd2f 100644 --- a/lib/footer/footer.dart +++ b/lib/footer/footer.dart @@ -1,7 +1,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:pinball/l10n/l10n.dart'; -import 'package:pinball/theme/theme.dart'; import 'package:pinball_ui/pinball_ui.dart'; /// {@template footer} @@ -35,7 +34,7 @@ class _GoogleIO extends StatelessWidget { final theme = Theme.of(context); return Text( l10n.footerGoogleIOText, - style: theme.textTheme.bodyText1!.copyWith(color: AppColors.white), + style: theme.textTheme.bodyText1!.copyWith(color: PinballColors.white), ); } } @@ -51,7 +50,7 @@ class _MadeWithFlutterAndFirebase extends StatelessWidget { textAlign: TextAlign.center, text: TextSpan( text: l10n.footerMadeWithText, - style: theme.textTheme.bodyText1!.copyWith(color: AppColors.white), + style: theme.textTheme.bodyText1!.copyWith(color: PinballColors.white), children: [ TextSpan( text: l10n.footerFlutterLinkText, diff --git a/lib/game/view/widgets/game_hud.dart b/lib/game/view/widgets/game_hud.dart index e3c44877..605bceb4 100644 --- a/lib/game/view/widgets/game_hud.dart +++ b/lib/game/view/widgets/game_hud.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:pinball/game/game.dart'; import 'package:pinball/gen/gen.dart'; -import 'package:pinball/theme/app_colors.dart'; +import 'package:pinball_ui/pinball_ui.dart'; /// {@template game_hud} /// Overlay on the [PinballGame]. @@ -72,7 +72,7 @@ class _ScoreViewDecoration extends StatelessWidget { decoration: BoxDecoration( borderRadius: radius, border: Border.all( - color: AppColors.white, + color: PinballColors.white, width: borderWidth, ), image: DecorationImage( diff --git a/lib/game/view/widgets/round_count_display.dart b/lib/game/view/widgets/round_count_display.dart index b8f67c26..63e1fa43 100644 --- a/lib/game/view/widgets/round_count_display.dart +++ b/lib/game/view/widgets/round_count_display.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:pinball/game/game.dart'; import 'package:pinball/l10n/l10n.dart'; -import 'package:pinball/theme/theme.dart'; +import 'package:pinball_ui/pinball_ui.dart'; /// {@template round_count_display} /// Colored square indicating if a round is available. @@ -20,9 +20,7 @@ class RoundCountDisplay extends StatelessWidget { children: [ Text( l10n.rounds, - style: AppTextStyle.subtitle1.copyWith( - color: AppColors.yellow, - ), + style: Theme.of(context).textTheme.subtitle1, ), const SizedBox(width: 8), Row( @@ -53,9 +51,9 @@ class RoundIndicator extends StatelessWidget { @override Widget build(BuildContext context) { - final color = isActive ? AppColors.yellow : AppColors.yellow.withAlpha(128); + final color = + isActive ? PinballColors.yellow : PinballColors.yellow.withAlpha(128); const size = 8.0; - return Padding( padding: const EdgeInsets.symmetric(horizontal: 8), child: Container( diff --git a/lib/game/view/widgets/score_view.dart b/lib/game/view/widgets/score_view.dart index 40b33c35..1fe57eb1 100644 --- a/lib/game/view/widgets/score_view.dart +++ b/lib/game/view/widgets/score_view.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:pinball/game/game.dart'; import 'package:pinball/l10n/l10n.dart'; -import 'package:pinball/theme/theme.dart'; import 'package:pinball_components/pinball_components.dart'; /// {@template score_view} @@ -38,9 +37,7 @@ class _GameOver extends StatelessWidget { return Text( l10n.gameOver, - style: AppTextStyle.headline1.copyWith( - color: AppColors.white, - ), + style: Theme.of(context).textTheme.headline1, ); } } @@ -58,9 +55,7 @@ class _ScoreDisplay extends StatelessWidget { children: [ Text( l10n.score.toLowerCase(), - style: AppTextStyle.subtitle1.copyWith( - color: AppColors.yellow, - ), + style: Theme.of(context).textTheme.subtitle1, ), const _ScoreText(), const RoundCountDisplay(), @@ -78,9 +73,7 @@ class _ScoreText extends StatelessWidget { return Text( score.formatScore(), - style: AppTextStyle.headline1.copyWith( - color: AppColors.white, - ), + style: Theme.of(context).textTheme.headline1, ); } } diff --git a/lib/start_game/widgets/how_to_play_dialog.dart b/lib/start_game/widgets/how_to_play_dialog.dart index 1665d35d..500a4288 100644 --- a/lib/start_game/widgets/how_to_play_dialog.dart +++ b/lib/start_game/widgets/how_to_play_dialog.dart @@ -5,7 +5,6 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:pinball/gen/gen.dart'; import 'package:pinball/l10n/l10n.dart'; -import 'package:pinball/theme/theme.dart'; import 'package:pinball_ui/pinball_ui.dart'; import 'package:platform_helper/platform_helper.dart'; @@ -122,7 +121,7 @@ class _MobileLaunchControls extends StatelessWidget { @override Widget build(BuildContext context) { final l10n = context.l10n; - const textStyle = AppTextStyle.subtitle3; + final textStyle = Theme.of(context).textTheme.headline3; return Column( children: [ Text( @@ -138,9 +137,7 @@ class _MobileLaunchControls extends StatelessWidget { ), TextSpan( text: l10n.launch, - style: textStyle.copyWith( - color: AppColors.blue, - ), + style: textStyle?.copyWith(color: PinballColors.blue), ), ], ), @@ -156,7 +153,7 @@ class _MobileFlipperControls extends StatelessWidget { @override Widget build(BuildContext context) { final l10n = context.l10n; - const textStyle = AppTextStyle.subtitle3; + final textStyle = Theme.of(context).textTheme.headline3; return Column( children: [ Text( @@ -172,9 +169,7 @@ class _MobileFlipperControls extends StatelessWidget { ), TextSpan( text: l10n.flip, - style: textStyle.copyWith( - color: AppColors.orange, - ), + style: textStyle?.copyWith(color: PinballColors.orange), ), ], ), @@ -207,21 +202,22 @@ class _HowToPlayHeader extends StatelessWidget { @override Widget build(BuildContext context) { final l10n = context.l10n; - const headerTextStyle = AppTextStyle.title; - + final textStyle = Theme.of(context).textTheme.headline3?.copyWith( + color: PinballColors.darkBlue, + ); return FittedBox( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( l10n.howToPlay, - style: headerTextStyle.copyWith( + style: textStyle?.copyWith( fontWeight: FontWeight.bold, ), ), Text( l10n.tipsForFlips, - style: headerTextStyle, + style: textStyle, ), ], ), @@ -241,7 +237,7 @@ class _DesktopLaunchControls extends StatelessWidget { children: [ Text( l10n.launchControls, - style: AppTextStyle.headline4, + style: Theme.of(context).textTheme.headline4, ), const SizedBox(height: 10), Wrap( @@ -270,7 +266,7 @@ class _DesktopFlipperControls extends StatelessWidget { children: [ Text( l10n.flipperControls, - style: AppTextStyle.subtitle2, + style: Theme.of(context).textTheme.subtitle2, ), const SizedBox(height: 10), Column( @@ -311,8 +307,9 @@ class KeyButton extends StatelessWidget { @override Widget build(BuildContext context) { + final textTheme = Theme.of(context).textTheme; final textStyle = - _control.isArrow ? AppTextStyle.headline1 : AppTextStyle.headline3; + _control.isArrow ? textTheme.headline1 : textTheme.headline3; const height = 60.0; final width = _control.isSpace ? height * 2.83 : height; return DecoratedBox( @@ -334,7 +331,7 @@ class KeyButton extends StatelessWidget { quarterTurns: _control.isDown ? 1 : 0, child: Text( _control.getCharacter(context), - style: textStyle.copyWith(color: AppColors.white), + style: textStyle?.copyWith(color: PinballColors.white), ), ), ), diff --git a/lib/theme/theme.dart b/lib/theme/theme.dart deleted file mode 100644 index c9e2f9e1..00000000 --- a/lib/theme/theme.dart +++ /dev/null @@ -1,2 +0,0 @@ -export 'app_colors.dart'; -export 'app_text_style.dart'; diff --git a/packages/pinball_ui/fonts/PixeloidMono-1G8ae.ttf b/packages/pinball_ui/fonts/PixeloidMono-1G8ae.ttf new file mode 100644 index 00000000..a797c1e1 Binary files /dev/null and b/packages/pinball_ui/fonts/PixeloidMono-1G8ae.ttf differ diff --git a/packages/pinball_ui/fonts/PixeloidSans-nR3g1.ttf b/packages/pinball_ui/fonts/PixeloidSans-nR3g1.ttf new file mode 100644 index 00000000..2f9a03b4 Binary files /dev/null and b/packages/pinball_ui/fonts/PixeloidSans-nR3g1.ttf differ diff --git a/packages/pinball_ui/fonts/PixeloidSansBold-RpeJo.ttf b/packages/pinball_ui/fonts/PixeloidSansBold-RpeJo.ttf new file mode 100644 index 00000000..81194f5d Binary files /dev/null and b/packages/pinball_ui/fonts/PixeloidSansBold-RpeJo.ttf differ diff --git a/packages/pinball_ui/lib/gen/fonts.gen.dart b/packages/pinball_ui/lib/gen/fonts.gen.dart new file mode 100644 index 00000000..5f77da16 --- /dev/null +++ b/packages/pinball_ui/lib/gen/fonts.gen.dart @@ -0,0 +1,16 @@ +/// GENERATED CODE - DO NOT MODIFY BY HAND +/// ***************************************************** +/// FlutterGen +/// ***************************************************** + +// ignore_for_file: directives_ordering,unnecessary_import + +class FontFamily { + FontFamily._(); + + /// Font family: PixeloidMono + static const String pixeloidMono = 'PixeloidMono'; + + /// Font family: PixeloidSans + static const String pixeloidSans = 'PixeloidSans'; +} diff --git a/packages/pinball_ui/lib/pinball_ui.dart b/packages/pinball_ui/lib/pinball_ui.dart index 6e139280..332286ed 100644 --- a/packages/pinball_ui/lib/pinball_ui.dart +++ b/packages/pinball_ui/lib/pinball_ui.dart @@ -5,3 +5,4 @@ export 'package:url_launcher_platform_interface/url_launcher_platform_interface. export 'src/dialog/dialog.dart'; export 'src/external_links/external_links.dart'; +export 'src/theme/theme.dart'; diff --git a/lib/theme/app_colors.dart b/packages/pinball_ui/lib/src/theme/pinball_colors.dart similarity index 92% rename from lib/theme/app_colors.dart rename to packages/pinball_ui/lib/src/theme/pinball_colors.dart index a12d3edc..5db27229 100644 --- a/lib/theme/app_colors.dart +++ b/packages/pinball_ui/lib/src/theme/pinball_colors.dart @@ -1,17 +1,11 @@ // ignore_for_file: public_member_api_docs - import 'package:flutter/material.dart'; -abstract class AppColors { +abstract class PinballColors { static const Color white = Color(0xFFFFFFFF); - static const Color darkBlue = Color(0xFF0C32A4); - static const Color yellow = Color(0xFFFFEE02); - static const Color orange = Color(0xFFE5AB05); - static const Color blue = Color(0xFF4B94F6); - static const Color transparent = Color(0x00000000); } diff --git a/lib/theme/app_text_style.dart b/packages/pinball_ui/lib/src/theme/pinball_text_style.dart similarity index 64% rename from lib/theme/app_text_style.dart rename to packages/pinball_ui/lib/src/theme/pinball_text_style.dart index 084936e9..378078fa 100644 --- a/lib/theme/app_text_style.dart +++ b/packages/pinball_ui/lib/src/theme/pinball_text_style.dart @@ -1,17 +1,18 @@ // ignore_for_file: public_member_api_docs import 'package:flutter/widgets.dart'; -import 'package:pinball/theme/theme.dart'; -import 'package:pinball_components/pinball_components.dart'; +import 'package:pinball_ui/gen/fonts.gen.dart'; +import 'package:pinball_ui/pinball_ui.dart'; const _fontPackage = 'pinball_components'; const _primaryFontFamily = FontFamily.pixeloidSans; -abstract class AppTextStyle { +abstract class PinballTextStyle { static const headline1 = TextStyle( fontSize: 28, package: _fontPackage, fontFamily: _primaryFontFamily, + color: PinballColors.white, ); static const headline2 = TextStyle( @@ -21,36 +22,22 @@ abstract class AppTextStyle { ); static const headline3 = TextStyle( - color: AppColors.white, + color: PinballColors.white, fontSize: 20, package: _fontPackage, fontFamily: _primaryFontFamily, + fontWeight: FontWeight.bold, ); static const headline4 = TextStyle( - color: AppColors.white, + color: PinballColors.white, fontSize: 16, package: _fontPackage, fontFamily: _primaryFontFamily, ); - static const title = TextStyle( - color: AppColors.darkBlue, - fontSize: 20, - package: _fontPackage, - fontFamily: _primaryFontFamily, - ); - - static const subtitle3 = TextStyle( - color: AppColors.white, - fontSize: 20, - fontWeight: FontWeight.bold, - package: _fontPackage, - fontFamily: _primaryFontFamily, - ); - static const subtitle2 = TextStyle( - color: AppColors.white, + color: PinballColors.white, fontSize: 16, package: _fontPackage, fontFamily: _primaryFontFamily, @@ -60,5 +47,6 @@ abstract class AppTextStyle { fontSize: 10, fontFamily: _primaryFontFamily, package: _fontPackage, + color: PinballColors.yellow, ); } diff --git a/packages/pinball_ui/lib/src/theme/pinball_theme.dart b/packages/pinball_ui/lib/src/theme/pinball_theme.dart new file mode 100644 index 00000000..cf62b2ef --- /dev/null +++ b/packages/pinball_ui/lib/src/theme/pinball_theme.dart @@ -0,0 +1,23 @@ +import 'package:flutter/material.dart'; +import 'package:pinball_ui/pinball_ui.dart'; + +/// Pinball theme +class PinballTheme { + /// Standard [ThemeData] for Pinball UI + static ThemeData get standard { + return ThemeData( + textTheme: _textTheme, + ); + } + + static TextTheme get _textTheme { + return const TextTheme( + headline1: PinballTextStyle.headline1, + headline2: PinballTextStyle.headline2, + headline3: PinballTextStyle.headline3, + headline4: PinballTextStyle.headline4, + subtitle1: PinballTextStyle.subtitle1, + subtitle2: PinballTextStyle.subtitle2, + ); + } +} diff --git a/packages/pinball_ui/lib/src/theme/theme.dart b/packages/pinball_ui/lib/src/theme/theme.dart new file mode 100644 index 00000000..71c78942 --- /dev/null +++ b/packages/pinball_ui/lib/src/theme/theme.dart @@ -0,0 +1,3 @@ +export 'pinball_colors.dart'; +export 'pinball_text_style.dart'; +export 'pinball_theme.dart'; diff --git a/packages/pinball_ui/pubspec.yaml b/packages/pinball_ui/pubspec.yaml index 60f32207..a89f7a67 100644 --- a/packages/pinball_ui/pubspec.yaml +++ b/packages/pinball_ui/pubspec.yaml @@ -23,6 +23,15 @@ flutter: generate: true assets: - assets/images/dialog/ + fonts: + - family: PixeloidSans + fonts: + - asset: fonts/PixeloidSans-nR3g1.ttf + - asset: fonts/PixeloidSansBold-RpeJo.ttf + weight: 700 + - family: PixeloidMono + fonts: + - asset: fonts/PixeloidMono-1G8ae.ttf flutter_gen: line_length: 80 diff --git a/packages/pinball_ui/test/src/theme/pinball_colors_test.dart b/packages/pinball_ui/test/src/theme/pinball_colors_test.dart new file mode 100644 index 00000000..36e45c0d --- /dev/null +++ b/packages/pinball_ui/test/src/theme/pinball_colors_test.dart @@ -0,0 +1,31 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:pinball_ui/pinball_ui.dart'; + +void main() { + group('PinballColors', () { + test('white is 0xFFFFFFFF', () { + expect(PinballColors.white, const Color(0xFFFFFFFF)); + }); + + test('darkBlue is 0xFF0C32A4', () { + expect(PinballColors.darkBlue, const Color(0xFF0C32A4)); + }); + + test('yellow is 0xFFFFEE02', () { + expect(PinballColors.yellow, const Color(0xFFFFEE02)); + }); + + test('orange is 0xFFE5AB05', () { + expect(PinballColors.orange, const Color(0xFFE5AB05)); + }); + + test('blue is 0xFF4B94F6', () { + expect(PinballColors.blue, const Color(0xFF4B94F6)); + }); + + test('transparent is 0x00000000', () { + expect(PinballColors.transparent, const Color(0x00000000)); + }); + }); +} diff --git a/packages/pinball_ui/test/src/theme/pinball_text_style_test.dart b/packages/pinball_ui/test/src/theme/pinball_text_style_test.dart new file mode 100644 index 00000000..60b382f3 --- /dev/null +++ b/packages/pinball_ui/test/src/theme/pinball_text_style_test.dart @@ -0,0 +1,41 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:pinball_ui/pinball_ui.dart'; + +void main() { + group('PinballTextStyle', () { + test('headline1 has fontSize 28 and white color', () { + const style = PinballTextStyle.headline1; + expect(style.fontSize, 28); + expect(style.color, PinballColors.white); + }); + + test('headline2 has fontSize 24', () { + const style = PinballTextStyle.headline2; + expect(style.fontSize, 24); + }); + + test('headline3 has fontSize 20 and white color', () { + const style = PinballTextStyle.headline3; + expect(style.fontSize, 20); + expect(style.color, PinballColors.white); + }); + + test('headline4 has fontSize 16 and white color', () { + const style = PinballTextStyle.headline4; + expect(style.fontSize, 16); + expect(style.color, PinballColors.white); + }); + + test('subtitle1 has fontSize 10 and yellow color', () { + const style = PinballTextStyle.subtitle1; + expect(style.fontSize, 10); + expect(style.color, PinballColors.yellow); + }); + + test('subtitle2 has fontSize 16 and white color', () { + const style = PinballTextStyle.subtitle2; + expect(style.fontSize, 16); + expect(style.color, PinballColors.white); + }); + }); +} diff --git a/packages/pinball_ui/test/src/theme/pinball_theme_test.dart b/packages/pinball_ui/test/src/theme/pinball_theme_test.dart new file mode 100644 index 00000000..915927f8 --- /dev/null +++ b/packages/pinball_ui/test/src/theme/pinball_theme_test.dart @@ -0,0 +1,98 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:pinball_ui/pinball_ui.dart'; + +void main() { + group('PinballTheme', () { + group('standard', () { + test('headline1 matches PinballTextStyle#headline1', () { + expect( + PinballTheme.standard.textTheme.headline1!.fontSize, + PinballTextStyle.headline1.fontSize, + ); + expect( + PinballTheme.standard.textTheme.headline1!.color, + PinballTextStyle.headline1.color, + ); + expect( + PinballTheme.standard.textTheme.headline1!.fontFamily, + PinballTextStyle.headline1.fontFamily, + ); + }); + + test('headline2 matches PinballTextStyle#headline2', () { + expect( + PinballTheme.standard.textTheme.headline2!.fontSize, + PinballTextStyle.headline2.fontSize, + ); + expect( + PinballTheme.standard.textTheme.headline2!.fontFamily, + PinballTextStyle.headline2.fontFamily, + ); + expect( + PinballTheme.standard.textTheme.headline2!.fontWeight, + PinballTextStyle.headline2.fontWeight, + ); + }); + + test('headline3 matches PinballTextStyle#headline3', () { + expect( + PinballTheme.standard.textTheme.headline3!.fontSize, + PinballTextStyle.headline3.fontSize, + ); + expect( + PinballTheme.standard.textTheme.headline3!.color, + PinballTextStyle.headline3.color, + ); + expect( + PinballTheme.standard.textTheme.headline3!.fontFamily, + PinballTextStyle.headline3.fontFamily, + ); + }); + + test('headline4 matches PinballTextStyle#headline4', () { + expect( + PinballTheme.standard.textTheme.headline4!.fontSize, + PinballTextStyle.headline4.fontSize, + ); + expect( + PinballTheme.standard.textTheme.headline4!.color, + PinballTextStyle.headline4.color, + ); + expect( + PinballTheme.standard.textTheme.headline4!.fontFamily, + PinballTextStyle.headline4.fontFamily, + ); + }); + + test('subtitle1 matches PinballTextStyle#subtitle1', () { + expect( + PinballTheme.standard.textTheme.subtitle1!.fontSize, + PinballTextStyle.subtitle1.fontSize, + ); + expect( + PinballTheme.standard.textTheme.subtitle1!.color, + PinballTextStyle.subtitle1.color, + ); + expect( + PinballTheme.standard.textTheme.subtitle1!.fontFamily, + PinballTextStyle.subtitle1.fontFamily, + ); + }); + + test('subtitle2 matches PinballTextStyle#subtitle2', () { + expect( + PinballTheme.standard.textTheme.subtitle2!.fontSize, + PinballTextStyle.subtitle2.fontSize, + ); + expect( + PinballTheme.standard.textTheme.subtitle2!.color, + PinballTextStyle.subtitle2.color, + ); + expect( + PinballTheme.standard.textTheme.subtitle2!.fontFamily, + PinballTextStyle.subtitle2.fontFamily, + ); + }); + }); + }); +} diff --git a/test/game/view/widgets/game_hud_test.dart b/test/game/view/widgets/game_hud_test.dart index d101d06e..79cc4f33 100644 --- a/test/game/view/widgets/game_hud_test.dart +++ b/test/game/view/widgets/game_hud_test.dart @@ -15,6 +15,7 @@ import 'package:mocktail/mocktail.dart'; import 'package:pinball/game/game.dart'; import 'package:pinball/l10n/l10n.dart'; import 'package:pinball_components/pinball_components.dart' hide Assets; +import 'package:pinball_ui/pinball_ui.dart'; import '../../../helpers/helpers.dart'; @@ -56,6 +57,7 @@ void main() { Future _pumpAppWithWidget(WidgetTester tester) async { await tester.pumpWidget( MaterialApp( + theme: PinballTheme.standard, localizationsDelegates: const [ AppLocalizations.delegate, GlobalMaterialLocalizations.delegate, diff --git a/test/game/view/widgets/round_count_display_test.dart b/test/game/view/widgets/round_count_display_test.dart index 8f5f7f13..335a1c32 100644 --- a/test/game/view/widgets/round_count_display_test.dart +++ b/test/game/view/widgets/round_count_display_test.dart @@ -2,7 +2,7 @@ import 'package:bloc_test/bloc_test.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:pinball/game/game.dart'; -import 'package:pinball/theme/app_colors.dart'; +import 'package:pinball_ui/pinball_ui.dart'; import '../../../helpers/helpers.dart'; @@ -108,7 +108,7 @@ void main() { expect( find.byWidgetPredicate( - (widget) => widget is Container && widget.color == AppColors.yellow, + (widget) => widget is Container && widget.color == PinballColors.yellow, ), findsOneWidget, ); @@ -125,7 +125,7 @@ void main() { find.byWidgetPredicate( (widget) => widget is Container && - widget.color == AppColors.yellow.withAlpha(128), + widget.color == PinballColors.yellow.withAlpha(128), ), findsOneWidget, ); diff --git a/test/helpers/pump_app.dart b/test/helpers/pump_app.dart index 2c112426..be67d4d0 100644 --- a/test/helpers/pump_app.dart +++ b/test/helpers/pump_app.dart @@ -17,6 +17,7 @@ import 'package:pinball/l10n/l10n.dart'; import 'package:pinball/select_character/select_character.dart'; import 'package:pinball/start_game/start_game.dart'; import 'package:pinball_audio/pinball_audio.dart'; +import 'package:pinball_ui/pinball_ui.dart'; import 'helpers.dart'; @@ -85,6 +86,7 @@ extension PumpApp on WidgetTester { ), ], child: MaterialApp( + theme: PinballTheme.standard, localizationsDelegates: const [ AppLocalizations.delegate, GlobalMaterialLocalizations.delegate,