Skip to content

Commit

Permalink
Merge pull request #658 from Mauritz8/mauritz/648
Browse files Browse the repository at this point in the history
fix flip board functionality
  • Loading branch information
veloce authored May 7, 2024
2 parents 34c4717 + 3fc0c1b commit 7427128
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/src/view/game/game_body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,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(
Expand Down

0 comments on commit 7427128

Please sign in to comment.