From 5f0bf0ea5fb418c9b37dcfdf592c4381feb2a57e Mon Sep 17 00:00:00 2001 From: Erick Zanardo Date: Thu, 10 Mar 2022 19:23:31 -0300 Subject: [PATCH] fix: rebase --- lib/game/pinball_game.dart | 3 +-- lib/game/view/pinball_game_page.dart | 11 ++++++++--- test/game/pinball_game_test.dart | 2 +- test/game/view/pinball_game_page_test.dart | 4 ++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/game/pinball_game.dart b/lib/game/pinball_game.dart index 455a1504..7d6fba41 100644 --- a/lib/game/pinball_game.dart +++ b/lib/game/pinball_game.dart @@ -107,8 +107,7 @@ class PinballGame extends Forge2DGame } class DebugPinballGame extends PinballGame with TapDetector { - - DebugPinballGame({ required PinballTheme theme}) : super(theme: theme); + DebugPinballGame({required PinballTheme theme}) : super(theme: theme); @override void onTapUp(TapUpInfo info) { diff --git a/lib/game/view/pinball_game_page.dart b/lib/game/view/pinball_game_page.dart index e0ce7dc9..4af2168e 100644 --- a/lib/game/view/pinball_game_page.dart +++ b/lib/game/view/pinball_game_page.dart @@ -30,8 +30,11 @@ class PinballGamePage extends StatelessWidget { } class PinballGameView extends StatefulWidget { - const PinballGameView({Key? key, required this.theme, bool isDebugMode = kDebugMode}) - : _isDebugMode = isDebugMode, + const PinballGameView({ + Key? key, + required this.theme, + bool isDebugMode = kDebugMode, + }) : _isDebugMode = isDebugMode, super(key: key); final PinballTheme theme; @@ -51,7 +54,9 @@ class _PinballGameViewState extends State { // TODO(erickzanardo): Revisit this when we start to have more assets // this could expose a Stream (maybe even a cubit?) so we could show the // the loading progress with some fancy widgets. - _game = (widget._isDebugMode ? DebugPinballGame(theme: widget.theme) : PinballGame(theme: widget.theme)) + _game = (widget._isDebugMode + ? DebugPinballGame(theme: widget.theme) + : PinballGame(theme: widget.theme)) ..preLoadAssets(); } diff --git a/test/game/pinball_game_test.dart b/test/game/pinball_game_test.dart index 202f76dd..ecc5dd90 100644 --- a/test/game/pinball_game_test.dart +++ b/test/game/pinball_game_test.dart @@ -12,7 +12,7 @@ void main() { group('PinballGame', () { TestWidgetsFlutterBinding.ensureInitialized(); final flameTester = FlameTester(PinballGameTest.create); - final debugModeFlameTester = FlameTester(DebugPinballGame.new); + final debugModeFlameTester = FlameTester(DebugPinballGameX.initial); // TODO(alestiago): test if [PinballGame] registers // [BallScorePointsCallback] once the following issue is resolved: diff --git a/test/game/view/pinball_game_page_test.dart b/test/game/view/pinball_game_page_test.dart index cd94d3ec..0e3ee963 100644 --- a/test/game/view/pinball_game_page_test.dart +++ b/test/game/view/pinball_game_page_test.dart @@ -113,7 +113,7 @@ void main() { ); await tester.pumpApp( - const PinballGameView(isDebugMode: false), + const PinballGameView(theme: theme, isDebugMode: false), gameBloc: gameBloc, ); expect( @@ -133,7 +133,7 @@ void main() { ); await tester.pumpApp( - const PinballGameView(), + const PinballGameView(theme: theme), gameBloc: gameBloc, ); expect(