sort players in winner selection

This commit is contained in:
2026-01-03 17:42:25 +01:00
parent 42cef337aa
commit 3c7c4598ff

View File

@@ -143,11 +143,17 @@ class _MatchResultViewState extends State<MatchResultView> {
} }
List<Player> getAllPlayers(Match match) { List<Player> getAllPlayers(Match match) {
List<Player> players = [];
if (match.group == null && match.players != null) { if (match.group == null && match.players != null) {
return [...match.players!]; players = [...match.players!];
} else if (match.group != null && match.players != null) { } else if (match.group != null && match.players != null) {
return [...match.players!, ...match.group!.members]; players = [...match.players!, ...match.group!.members];
} else {
players = [...match.group!.members];
} }
return [...match.group!.members];
players.sort((a, b) => a.name.compareTo(b.name));
return players;
} }
} }