add deleted attribute
This commit is contained in:
@@ -7,6 +7,7 @@ class Player {
|
||||
final String name;
|
||||
int nameCount;
|
||||
final String description;
|
||||
final bool deleted;
|
||||
|
||||
Player({
|
||||
String? id,
|
||||
@@ -14,6 +15,7 @@ class Player {
|
||||
required this.name,
|
||||
this.nameCount = 0,
|
||||
String? description,
|
||||
this.deleted = false,
|
||||
}) : id = id ?? const Uuid().v4(),
|
||||
createdAt = createdAt ?? clock.now(),
|
||||
description = description ?? '';
|
||||
@@ -29,7 +31,8 @@ class Player {
|
||||
createdAt = DateTime.parse(json['createdAt']),
|
||||
name = json['name'],
|
||||
nameCount = 0,
|
||||
description = json['description'];
|
||||
description = json['description'],
|
||||
deleted = json['deleted'] ?? false;
|
||||
|
||||
/// Converts the Player instance to a JSON object.
|
||||
Map<String, dynamic> toJson() => {
|
||||
@@ -37,5 +40,6 @@ class Player {
|
||||
'createdAt': createdAt.toIso8601String(),
|
||||
'name': name,
|
||||
'description': description,
|
||||
'deleted': deleted,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user