add deleted attribute
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user