Merge remote-tracking branch 'origin/development' into bug/195-datenbank-onDelete-ueberpruefen
# Conflicts: # assets/schema.json # lib/data/db/tables/player_match_table.dart # lib/data/models/game.dart
This commit is contained in:
@@ -25,7 +25,36 @@ class Player {
|
||||
return 'Player{id: $id, createdAt: $createdAt, name: $name, nameCount: $nameCount, description: $description}';
|
||||
}
|
||||
|
||||
/// Creates a Player instance from a JSON object.
|
||||
Player copyWith({
|
||||
String? id,
|
||||
DateTime? createdAt,
|
||||
String? name,
|
||||
int? nameCount,
|
||||
String? description,
|
||||
}) {
|
||||
return Player(
|
||||
id: id ?? this.id,
|
||||
createdAt: createdAt ?? this.createdAt,
|
||||
name: name ?? this.name,
|
||||
nameCount: nameCount ?? this.nameCount,
|
||||
description: description ?? this.description,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is Player &&
|
||||
runtimeType == other.runtimeType &&
|
||||
id == other.id &&
|
||||
createdAt == other.createdAt &&
|
||||
name == other.name &&
|
||||
nameCount == other.nameCount &&
|
||||
description == other.description;
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(id, createdAt, name, nameCount, description);
|
||||
|
||||
Player.fromJson(Map<String, dynamic> json)
|
||||
: id = json['id'],
|
||||
createdAt = DateTime.parse(json['createdAt']),
|
||||
@@ -34,7 +63,6 @@ class Player {
|
||||
description = json['description'],
|
||||
deleted = json['deleted'] ?? false;
|
||||
|
||||
/// Converts the Player instance to a JSON object.
|
||||
Map<String, dynamic> toJson() => {
|
||||
'id': id,
|
||||
'createdAt': createdAt.toIso8601String(),
|
||||
|
||||
Reference in New Issue
Block a user