pull/143/head
Erick Zanardo 4 years ago
parent d4493e5a69
commit 8829bba9b3

@ -47,7 +47,6 @@ class PinballGameView extends StatefulWidget {
class _PinballGameViewState extends State<PinballGameView> {
late PinballGame _game;
bool _loading = true;
@override
void initState() {
@ -71,18 +70,10 @@ class _PinballGameViewState extends State<PinballGameView> {
_game.preLoadAssets(),
pinballAudio.load(),
]);
setState(() {
_loading = false;
});
}
@override
Widget build(BuildContext context) {
if (_loading) {
return const Center(child: CircularProgressIndicator());
}
return BlocListener<GameBloc, GameState>(
listenWhen: (previous, current) =>
previous.isGameOver != current.isGameOver,

@ -14,10 +14,12 @@ class FlameBlocTester<T extends FlameGame, B extends Bloc<dynamic, dynamic>>
await tester.pumpWidget(
BlocProvider.value(
value: blocBuilder(),
child: MultiRepositoryProvider(
providers: repositories?.call() ?? [],
child: gameWidget,
),
child: repositories == null
? gameWidget
: MultiRepositoryProvider(
providers: repositories.call(),
child: gameWidget,
),
),
);
},

Loading…
Cancel
Save