fix: sorting problems
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 44s
Pull Request Pipeline / lint (pull_request) Successful in 51s

This commit is contained in:
2026-05-22 15:05:43 +02:00
parent 96037e6062
commit 47829a6955
4 changed files with 7 additions and 5 deletions

View File

@@ -406,7 +406,8 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
teamIds.map((teamId) => db.teamDao.getTeamById(teamId: teamId)),
);
return teams;
return teams
..sort((a, b) => a.name.toLowerCase().compareTo(b.name.toLowerCase()));
}
/* Update */

View File

@@ -74,7 +74,8 @@ class PlayerMatchDao extends DatabaseAccessor<AppDatabase>
(row) => db.playerDao.getPlayerById(playerId: row.playerId),
);
final players = await Future.wait(futures);
return players;
return players
..sort((a, b) => a.name.toLowerCase().compareTo(b.name.toLowerCase()));
}
/// Retrieves a list of [Player]s associated with a specific team in a match.

View File

@@ -173,7 +173,8 @@ class TeamDao extends DatabaseAccessor<AppDatabase> with _$TeamDaoMixin {
final players = await Future.wait(
playerIds.map((id) => db.playerDao.getPlayerById(playerId: id)),
);
return players;
return players
..sort((a, b) => a.name.toLowerCase().compareTo(b.name.toLowerCase()));
}
/* Update */

View File

@@ -208,7 +208,6 @@ class _MatchResultViewState extends State<MatchResultView> {
void initializeAsTeamMatch() {
allTeams = [...(widget.match.teams ?? [])];
allTeams.sort((a, b) => a.name.compareTo(b.name));
controller = List.generate(
allTeams.length,
@@ -508,7 +507,7 @@ class _MatchResultViewState extends State<MatchResultView> {
),
),
),
if (team.members.length > 4)
if (team.members.length > showingPlayerAmount)
Container(
padding: const EdgeInsets.symmetric(
vertical: 4,