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

@@ -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,
};
}