Skip to content

Commit b10de32

Browse files
authored
fix: otb config bottom sheet will show up at otb game start (#2320)
1 parent 1f809a0 commit b10de32

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

lib/src/view/over_the_board/over_the_board_screen.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ class _BodyState extends ConsumerState<_Body> {
6363

6464
Side orientation = Side.white;
6565

66+
@override
67+
void initState() {
68+
super.initState();
69+
WidgetsBinding.instance.addPostFrameCallback((_) {
70+
showConfigureGameSheet(context, isDismissible: true);
71+
});
72+
}
73+
6674
@override
6775
Widget build(BuildContext context) {
6876
final gameState = ref.watch(overTheBoardGameControllerProvider);

test/view/over_the_board/over_the_board_screen_test.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,16 @@ void main() {
179179
Future<Rect> initOverTheBoardGame(WidgetTester tester, TimeIncrement timeIncrement) async {
180180
final app = await makeTestProviderScopeApp(tester, home: const OverTheBoardScreen());
181181
await tester.pumpWidget(app);
182+
183+
// Wait for bottom sheet to show up
184+
await tester.pumpAndSettle();
185+
186+
// User taps Play to start game now
187+
await tester.tap(find.text('Play'));
188+
189+
// Wait for bottom sheet to disappear
190+
await tester.pumpAndSettle();
191+
182192
await tester.tap(find.byIcon(CupertinoIcons.play));
183193

184194
final container = ProviderScope.containerOf(tester.element(find.byType(Chessboard)));

0 commit comments

Comments
 (0)