From d90b9b1bc206850936187946ed460984994bc5d8 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sun, 20 Jul 2025 20:20:52 +0200 Subject: [PATCH] Updated gameSession class --- lib/data/game_session.dart | 5 ++--- test/data/game_session_test.dart | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/data/game_session.dart b/lib/data/game_session.dart index d1402e5..a9164be 100644 --- a/lib/data/game_session.dart +++ b/lib/data/game_session.dart @@ -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 players; @@ -27,6 +27,7 @@ class GameSession extends ChangeNotifier { List 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 diff --git a/test/data/game_session_test.dart b/test/data/game_session_test.dart index 4ca2158..9654bad 100644 --- a/test/data/game_session_test.dart +++ b/test/data/game_session_test.dart @@ -9,6 +9,7 @@ void main() { setUp(() { session = GameSession( + id: '1', createdAt: testDate, gameTitle: testTitle, players: testPlayers,