From 8a5d8f4e5d709ea6c859f39672c4747cac6b18ae Mon Sep 17 00:00:00 2001 From: evgfilim1 Date: Fri, 5 Apr 2024 16:45:36 +0500 Subject: [PATCH] Highlight winner team --- lib/widgets/player_buttons.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/widgets/player_buttons.dart b/lib/widgets/player_buttons.dart index 9b0146f..ad164d5 100644 --- a/lib/widgets/player_buttons.dart +++ b/lib/widgets/player_buttons.dart @@ -62,7 +62,7 @@ class _PlayerButtonsState extends OrientationDependentState { Widget _buildPlayerButton(BuildContext context, int playerNumber, BaseGameState gameState) { final controller = context.watch(); final isActive = switch (gameState) { - GameStatePrepare() || GameStateNightRest() || GameStateFinish() => false, + GameStatePrepare() || GameStateNightRest() => false, GameStateWithPlayer(currentPlayerNumber: final p) || GameStateSpeaking(currentPlayerNumber: final p) || GameStateWithIterablePlayers(currentPlayerNumber: final p) || @@ -75,6 +75,8 @@ class _PlayerButtonsState extends OrientationDependentState { ps.contains(playerNumber), GameStateNightKill() => controller.getPlayerByNumber(playerNumber).role.team == RoleTeam.mafia, + GameStateFinish(:final winner) => + controller.getPlayerByNumber(playerNumber).role.team == winner, }; final isSelected = switch (gameState) { GameStateSpeaking(accusations: final accusations) => accusations.containsValue(playerNumber),