fix: restore GameHud visibility (#240)

pull/249/head
arturplaczek 2 years ago committed by GitHub
parent 49774a5279
commit 46e9152225
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -114,9 +114,6 @@ class PinballGameLoadedView extends StatelessWidget {
@override
Widget build(BuildContext context) {
final isPlaying = context.select(
(StartGameBloc bloc) => bloc.state.status == StartGameStatus.play,
);
final gameWidgetWidth = MediaQuery.of(context).size.height * 9 / 16;
final screenWidth = MediaQuery.of(context).size.width;
final leftMargin = (screenWidth / 2) - (gameWidgetWidth / 1.8);
@ -139,13 +136,12 @@ class PinballGameLoadedView extends StatelessWidget {
},
),
),
// TODO(arturplaczek): add Visibility to GameHud based on StartGameBloc
// status
Positioned(
top: 16,
left: leftMargin,
child: Visibility(
visible: isPlaying,
child: const GameHud(),
),
child: const GameHud(),
),
],
);

@ -198,10 +198,12 @@ void main() {
find.byWidgetPredicate((w) => w is GameWidget<PinballGame>),
findsOneWidget,
);
expect(
find.byType(GameHud),
findsNothing,
);
// TODO(arturplaczek): add Visibility to GameHud based on StartGameBloc
// status
// expect(
// find.byType(GameHud),
// findsNothing,
// );
});
testWidgets('renders a hud on play state', (tester) async {

Loading…
Cancel
Save