fix: apply code review

pull/195/head
arturplaczek 3 years ago
parent 97fc49ee9c
commit 2a72e3a545

@ -27,13 +27,12 @@ class PlayButtonOverlay extends StatelessWidget {
showDialog<void>( showDialog<void>(
context: context, context: context,
builder: (_) { builder: (_) {
final width = MediaQuery.of(context).size.width * 0.9; final height = MediaQuery.of(context).size.height * 0.5;
final height = MediaQuery.of(context).size.height * 0.9;
return Center( return Center(
child: SizedBox( child: SizedBox(
height: height, height: height,
width: width, width: height * 1.4,
child: const CharacterSelectionDialog(), child: const CharacterSelectionDialog(),
), ),
); );

@ -5,7 +5,6 @@
// license that can be found in the LICENSE file or at // license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT. // https://opensource.org/licenses/MIT.
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:leaderboard_repository/leaderboard_repository.dart'; import 'package:leaderboard_repository/leaderboard_repository.dart';
import 'package:mocktail/mocktail.dart'; import 'package:mocktail/mocktail.dart';
@ -29,13 +28,10 @@ void main() {
testWidgets('renders PinballGamePage', (tester) async { testWidgets('renders PinballGamePage', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
RepositoryProvider<PinballAudio>( App(
create: (_) => pinballAudio,
child: App(
leaderboardRepository: leaderboardRepository, leaderboardRepository: leaderboardRepository,
pinballAudio: pinballAudio, pinballAudio: pinballAudio,
), ),
),
); );
expect(find.byType(PinballGamePage), findsOneWidget); expect(find.byType(PinballGamePage), findsOneWidget);
}); });

@ -33,7 +33,7 @@ void main() {
verify(gameFlowController.start).called(1); verify(gameFlowController.start).called(1);
}); });
testWidgets('is showing CharacterSelectionDialog when tapped', testWidgets('displays CharacterSelectionDialog when tapped',
(tester) async { (tester) async {
await tester.pumpApp(PlayButtonOverlay(game: game)); await tester.pumpApp(PlayButtonOverlay(game: game));

@ -83,7 +83,7 @@ void main() {
verify(() => themeCubit.characterSelected(SparkyTheme())).called(1); verify(() => themeCubit.characterSelected(SparkyTheme())).called(1);
}); });
testWidgets('is showing how to play dialog when start is tapped', testWidgets('displays how to play dialog when start is tapped',
(tester) async { (tester) async {
await tester.pumpApp( await tester.pumpApp(
CharacterSelectionView(), CharacterSelectionView(),

Loading…
Cancel
Save