Changed winner access in statistics view
This commit is contained in:
@@ -127,13 +127,13 @@ class _StatisticsViewState extends State<StatisticsView> {
|
|||||||
// Getting the winners
|
// Getting the winners
|
||||||
for (var game in games) {
|
for (var game in games) {
|
||||||
final winner = game.winner;
|
final winner = game.winner;
|
||||||
if (winner != null && winner.isNotEmpty) {
|
if (winner != null) {
|
||||||
final index = winCounts.indexWhere((entry) => entry.$1 == winner);
|
final index = winCounts.indexWhere((entry) => entry.$1 == winner.id);
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
final current = winCounts[index].$2;
|
final current = winCounts[index].$2;
|
||||||
winCounts[index] = (winner, current + 1);
|
winCounts[index] = (winner.id, current + 1);
|
||||||
} else {
|
} else {
|
||||||
winCounts.add((winner, 1));
|
winCounts.add((winner.id, 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user