fix: rebase

pull/28/head
Erick Zanardo 4 years ago
parent 5f63abac7a
commit 5f0bf0ea5f

@ -107,7 +107,6 @@ class PinballGame extends Forge2DGame
} }
class DebugPinballGame extends PinballGame with TapDetector { class DebugPinballGame extends PinballGame with TapDetector {
DebugPinballGame({required PinballTheme theme}) : super(theme: theme); DebugPinballGame({required PinballTheme theme}) : super(theme: theme);
@override @override

@ -30,8 +30,11 @@ class PinballGamePage extends StatelessWidget {
} }
class PinballGameView extends StatefulWidget { class PinballGameView extends StatefulWidget {
const PinballGameView({Key? key, required this.theme, bool isDebugMode = kDebugMode}) const PinballGameView({
: _isDebugMode = isDebugMode, Key? key,
required this.theme,
bool isDebugMode = kDebugMode,
}) : _isDebugMode = isDebugMode,
super(key: key); super(key: key);
final PinballTheme theme; final PinballTheme theme;
@ -51,7 +54,9 @@ class _PinballGameViewState extends State<PinballGameView> {
// TODO(erickzanardo): Revisit this when we start to have more assets // 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 // this could expose a Stream (maybe even a cubit?) so we could show the
// the loading progress with some fancy widgets. // 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(); ..preLoadAssets();
} }

@ -12,7 +12,7 @@ void main() {
group('PinballGame', () { group('PinballGame', () {
TestWidgetsFlutterBinding.ensureInitialized(); TestWidgetsFlutterBinding.ensureInitialized();
final flameTester = FlameTester(PinballGameTest.create); final flameTester = FlameTester(PinballGameTest.create);
final debugModeFlameTester = FlameTester(DebugPinballGame.new); final debugModeFlameTester = FlameTester(DebugPinballGameX.initial);
// TODO(alestiago): test if [PinballGame] registers // TODO(alestiago): test if [PinballGame] registers
// [BallScorePointsCallback] once the following issue is resolved: // [BallScorePointsCallback] once the following issue is resolved:

@ -113,7 +113,7 @@ void main() {
); );
await tester.pumpApp( await tester.pumpApp(
const PinballGameView(isDebugMode: false), const PinballGameView(theme: theme, isDebugMode: false),
gameBloc: gameBloc, gameBloc: gameBloc,
); );
expect( expect(
@ -133,7 +133,7 @@ void main() {
); );
await tester.pumpApp( await tester.pumpApp(
const PinballGameView(), const PinballGameView(theme: theme),
gameBloc: gameBloc, gameBloc: gameBloc,
); );
expect( expect(

Loading…
Cancel
Save