Skip to content

Commit

Permalink
fix flip board functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauritz8 committed May 3, 2024
1 parent ed3aa87 commit 6bd6e58
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/src/view/game/game_body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,14 @@ 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 6bd6e58

Please sign in to comment.