diff --git a/lib/presentation/views/main_menu/match_view/match_result_view.dart b/lib/presentation/views/main_menu/match_view/match_result_view.dart index e8075f6..c2076cc 100644 --- a/lib/presentation/views/main_menu/match_view/match_result_view.dart +++ b/lib/presentation/views/main_menu/match_view/match_result_view.dart @@ -143,11 +143,17 @@ class _MatchResultViewState extends State { } List getAllPlayers(Match match) { + List players = []; + if (match.group == null && match.players != null) { - return [...match.players!]; + players = [...match.players!]; } 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; } } diff --git a/lib/presentation/widgets/tiles/group_tile.dart b/lib/presentation/widgets/tiles/group_tile.dart index 248c1c6..5f870de 100644 --- a/lib/presentation/widgets/tiles/group_tile.dart +++ b/lib/presentation/widgets/tiles/group_tile.dart @@ -56,7 +56,9 @@ class GroupTile extends StatelessWidget { spacing: 12.0, runSpacing: 8.0, children: [ - for (var member in group.members) + for (var member in [ + ...group.members, + ]..sort((a, b) => a.name.compareTo(b.name))) TextIconTile(text: member.name, iconEnabled: false), ], ), diff --git a/lib/presentation/widgets/tiles/match_tile.dart b/lib/presentation/widgets/tiles/match_tile.dart index 543a542..bfe1b9f 100644 --- a/lib/presentation/widgets/tiles/match_tile.dart +++ b/lib/presentation/widgets/tiles/match_tile.dart @@ -175,6 +175,7 @@ class _MatchTileState extends State { } } + allPlayers.sort((a, b) => a.name.compareTo(b.name)); return allPlayers; } }