diff --git a/lib/team_selection/view/team_selection_page.dart b/lib/team_selection/view/team_selection_page.dart index 01082c826..05f7ce0a8 100644 --- a/lib/team_selection/view/team_selection_page.dart +++ b/lib/team_selection/view/team_selection_page.dart @@ -160,7 +160,7 @@ class _TeamSelectorLarge extends StatelessWidget { child: SizedBox( width: mascotWidth, height: mascotHeight, - child: TeamSelectionMascot(Mascots.dash), + child: _LargeMascot(Mascots.dash), ), ), Positioned( @@ -169,7 +169,7 @@ class _TeamSelectorLarge extends StatelessWidget { child: SizedBox( width: mascotWidth, height: mascotHeight, - child: TeamSelectionMascot(Mascots.sparky), + child: _LargeMascot(Mascots.sparky), ), ), Positioned( @@ -178,7 +178,7 @@ class _TeamSelectorLarge extends StatelessWidget { child: SizedBox( width: mascotWidth, height: mascotHeight, - child: TeamSelectionMascot(Mascots.android), + child: _LargeMascot(Mascots.android), ), ), Positioned( @@ -187,7 +187,7 @@ class _TeamSelectorLarge extends StatelessWidget { child: SizedBox( width: mascotWidth, height: mascotHeight, - child: TeamSelectionMascot(Mascots.dino), + child: _LargeMascot(Mascots.dino), ), ), ], @@ -547,3 +547,22 @@ class _SmallMascot extends StatelessWidget { ); } } + +class _LargeMascot extends StatelessWidget { + const _LargeMascot(this.mascot); + + final Mascots mascot; + + @override + Widget build(BuildContext context) { + return MouseRegion( + cursor: SystemMouseCursors.click, + child: GestureDetector( + onTap: () { + context.read().selectTeam(mascot.index); + }, + child: TeamSelectionMascot(mascot), + ), + ); + } +} diff --git a/test/team_selection/view/team_selection_page_test.dart b/test/team_selection/view/team_selection_page_test.dart index 204d48483..bcff2940a 100644 --- a/test/team_selection/view/team_selection_page_test.dart +++ b/test/team_selection/view/team_selection_page_test.dart @@ -322,5 +322,31 @@ void main() { }, ); }); + + testWidgets( + 'select Sparky mascot when tapped ' + 'on large layout', (tester) async { + tester.view.physicalSize = const Size(1600, 1600); + + when(() => teamSelectionCubit.state).thenReturn( + TeamSelectionState(assetsStatus: AssetsLoadingStatus.success), + ); + + await tester.pumpApp( + widget, + layout: IoLayoutData.large, + ); + + await tester.pump(); + + await tester.tap( + find.byType(TeamSelectionMascot).at(Mascots.sparky.index), + ); + + verify(() => teamSelectionCubit.selectTeam(Mascots.sparky.index)) + .called(1); + + addTearDown(tester.view.resetPhysicalSize); + }); }); }