Neue Datenbank Struktur #156

Open
gelbeinhalb wants to merge 88 commits from feature/88-neue-datenbank-struktur into development
Showing only changes of commit c82d72544e - Show all commits

View File

@@ -5,26 +5,33 @@ class Player {
final String id; final String id;
final DateTime createdAt; final DateTime createdAt;
final String name; final String name;
final String? description;
gelbeinhalb marked this conversation as resolved Outdated

Leerer String statt nullable

Leerer String statt nullable
Player({String? id, DateTime? createdAt, required this.name}) Player({
: id = id ?? const Uuid().v4(), String? id,
DateTime? createdAt,
required this.name,
this.description,
Review

Description optional

Description optional
Review

Wieso? Ich dachte wir machen alles als leeren String?

Wieso? Ich dachte wir machen alles als leeren String?
Review

s.o.

s.o.
}) : id = id ?? const Uuid().v4(),
createdAt = createdAt ?? clock.now(); createdAt = createdAt ?? clock.now();
@override @override
String toString() { String toString() {
return 'Player{id: $id,name: $name}'; return 'Player{id: $id, name: $name, description: $description}';
} }
/// Creates a Player instance from a JSON object. /// Creates a Player instance from a JSON object.
Player.fromJson(Map<String, dynamic> json) Player.fromJson(Map<String, dynamic> json)
: id = json['id'], : id = json['id'],
createdAt = DateTime.parse(json['createdAt']), createdAt = DateTime.parse(json['createdAt']),
name = json['name']; name = json['name'],
description = json['description'];
/// Converts the Player instance to a JSON object. /// Converts the Player instance to a JSON object.
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
'id': id, 'id': id,
'createdAt': createdAt.toIso8601String(), 'createdAt': createdAt.toIso8601String(),
'name': name, 'name': name,
'description': description,
}; };
} }