Adjusted attributes to table definition

This commit is contained in:
2025-11-19 00:23:28 +01:00
parent f6ebda7984
commit 5dcd0826bd
4 changed files with 4 additions and 11 deletions

View File

@@ -57,7 +57,7 @@ class GameDao extends DatabaseAccessor<AppDatabase> with _$GameDaoMixin {
GameTableCompanion.insert( GameTableCompanion.insert(
id: game.id, id: game.id,
name: game.name, name: game.name,
winnerId: game.winner, winnerId: Value(game.winner),
), ),
mode: InsertMode.insertOrReplace, mode: InsertMode.insertOrReplace,
); );

View File

@@ -4,6 +4,5 @@ part of 'game_dao.dart';
// ignore_for_file: type=lint // ignore_for_file: type=lint
mixin _$GameDaoMixin on DatabaseAccessor<AppDatabase> { mixin _$GameDaoMixin on DatabaseAccessor<AppDatabase> {
$PlayerTableTable get playerTable => attachedDatabase.playerTable;
$GameTableTable get gameTable => attachedDatabase.gameTable; $GameTableTable get gameTable => attachedDatabase.gameTable;
} }

View File

@@ -5,7 +5,6 @@ part of 'group_game_dao.dart';
// ignore_for_file: type=lint // ignore_for_file: type=lint
mixin _$GroupGameDaoMixin on DatabaseAccessor<AppDatabase> { mixin _$GroupGameDaoMixin on DatabaseAccessor<AppDatabase> {
$GroupTableTable get groupTable => attachedDatabase.groupTable; $GroupTableTable get groupTable => attachedDatabase.groupTable;
$PlayerTableTable get playerTable => attachedDatabase.playerTable;
$GameTableTable get gameTable => attachedDatabase.gameTable; $GameTableTable get gameTable => attachedDatabase.gameTable;
$GroupGameTableTable get groupGameTable => attachedDatabase.groupGameTable; $GroupGameTableTable get groupGameTable => attachedDatabase.groupGameTable;
} }

View File

@@ -7,15 +7,10 @@ class Game {
final String name; final String name;
final List<Player>? players; final List<Player>? players;
final Group? group; final Group? group;
final String winner; final String? winner;
Game({ Game({String? id, required this.name, this.players, this.group, this.winner})
String? id, : id = id ?? const Uuid().v4();
required this.name,
this.players,
this.group,
this.winner = '',
}) : id = id ?? const Uuid().v4();
@override @override
String toString() { String toString() {