From 3fc0c1b2b0512c530820dbf189c6b6cbfb1e6a03 Mon Sep 17 00:00:00 2001 From: Mauritz Date: Fri, 3 May 2024 06:35:26 +0200 Subject: [PATCH] fix flip board functionality --- lib/src/view/game/game_body.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/src/view/game/game_body.dart b/lib/src/view/game/game_body.dart index c2902ea3fd..0f9f8f5204 100644 --- a/lib/src/view/game/game_body.dart +++ b/lib/src/view/game/game_body.dart @@ -203,10 +203,13 @@ class GameBody extends ConsumerWidget { : null, ); - final topPlayer = youAre == Side.white ? black : white; - final bottomPlayer = youAre == Side.white ? white : black; final isBoardTurned = ref.watch(isBoardTurnedProvider); + final topPlayerIsBlack = youAre == Side.white && !isBoardTurned || + youAre == Side.black && isBoardTurned; + final topPlayer = topPlayerIsBlack ? black : white; + final bottomPlayer = topPlayerIsBlack ? white : black; + final content = WakelockWidget( shouldEnableOnFocusGained: () => gameState.game.playable, child: PopScope(