players cant be null
Some checks failed
Pull Request Pipeline / test (pull_request) Failing after 40s
Pull Request Pipeline / lint (pull_request) Failing after 44s

This commit is contained in:
gelbeinhalb
2026-02-01 18:23:58 +01:00
parent dbef735a82
commit 7aba8554c0
7 changed files with 46 additions and 61 deletions

View File

@@ -12,7 +12,7 @@ class Match {
final String name;
final Game game;
final Group? group;
final List<Player>? players;
final List<Player> players;
final String notes;
Player? winner;
@@ -23,7 +23,7 @@ class Match {
required this.name,
required this.game,
this.group,
this.players,
this.players = const [],
required this.notes,
this.winner,
}) : id = id ?? const Uuid().v4(),
@@ -54,7 +54,7 @@ class Match {
'name': name,
'gameId': game.id,
'groupId': group?.id,
'playerIds': (players ?? []).map((player) => player.id).toList(),
'playerIds': players.map((player) => player.id).toList(),
'notes': notes,
};
}