Updated gameSession class

This commit is contained in:
2025-07-20 20:20:52 +02:00
parent 35cfba457d
commit d90b9b1bc2
2 changed files with 3 additions and 3 deletions

View File

@@ -13,7 +13,7 @@ import 'package:uuid/uuid.dart';
/// [isGameFinished] is a boolean indicating if the game has ended yet.
/// [winner] is the name of the player who won the game.
class GameSession extends ChangeNotifier {
late String id;
final String id;
final DateTime createdAt;
final String gameTitle;
final List<String> players;
@@ -27,6 +27,7 @@ class GameSession extends ChangeNotifier {
List<Round> roundList = [];
GameSession({
required this.id,
required this.createdAt,
required this.gameTitle,
required this.players,
@@ -35,8 +36,6 @@ class GameSession extends ChangeNotifier {
required this.isPointsLimitEnabled,
}) {
playerScores = List.filled(players.length, 0);
var uuid = const Uuid();
id = uuid.v1();
}
@override

View File

@@ -9,6 +9,7 @@ void main() {
setUp(() {
session = GameSession(
id: '1',
createdAt: testDate,
gameTitle: testTitle,
players: testPlayers,