add deleted attribute
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 45s
Pull Request Pipeline / lint (pull_request) Successful in 46s

This commit is contained in:
gelbeinhalb
2026-04-30 11:56:15 +02:00
parent 1ec1df3514
commit 66e657235a
6 changed files with 30 additions and 7 deletions

View File

@@ -10,6 +10,7 @@ class Game {
final String description;
final GameColor color;
final String icon;
final bool deleted;
Game({
String? id,
@@ -19,6 +20,7 @@ class Game {
String? description,
required this.color,
required this.icon,
this.deleted = false,
}) : id = id ?? const Uuid().v4(),
createdAt = createdAt ?? clock.now(),
description = description ?? '';
@@ -39,7 +41,8 @@ class Game {
),
description = json['description'],
color = GameColor.values.firstWhere((e) => e.name == json['color']),
icon = json['icon'];
icon = json['icon'],
deleted = json['deleted'] ?? false;
/// Converts the Game instance to a JSON object.
Map<String, dynamic> toJson() => {
@@ -50,5 +53,6 @@ class Game {
'description': description,
'color': color.name,
'icon': icon,
'deleted': deleted,
};
}