diff --git a/lib/presentation/views/active_game_view.dart b/lib/presentation/views/active_game_view.dart index 1ea0a0d..9715f77 100644 --- a/lib/presentation/views/active_game_view.dart +++ b/lib/presentation/views/active_game_view.dart @@ -35,7 +35,8 @@ class _ActiveGameViewState extends State { listenable: gameSession, builder: (context, _) { sortedPlayerIndices = _getSortedPlayerIndices(); - denseRanks = _calculateDenseRank(gameSession.playerScores); + denseRanks = _calculateDenseRank( + gameSession.playerScores, sortedPlayerIndices); return CupertinoPageScaffold( navigationBar: CupertinoNavigationBar( middle: Text(gameSession.gameTitle), @@ -278,8 +279,8 @@ class _ActiveGameViewState extends State { } /// Calculates the dense rank for a player based on their index in the sorted list of players. - List _calculateDenseRank(List playerScores) { - List sortedIndices = _getSortedPlayerIndices(); + List _calculateDenseRank( + List playerScores, List sortedIndices) { List denseRanks = []; int rank = 1; for (int i = 0; i < sortedIndices.length; i++) {