Added toString method + default values

This commit is contained in:
2026-04-21 22:11:09 +02:00
parent 31c6e03f4d
commit 571d32f07a

View File

@@ -1,13 +1,14 @@
class ScoreEntry {
int roundNumber = 0;
final int roundNumber;
final int score;
final int change;
ScoreEntry({
required this.roundNumber,
required this.score,
required this.change,
});
ScoreEntry({required this.score, this.roundNumber = 0, this.change = 0});
@override
String toString() {
return 'ScoreEntry{roundNumber: $roundNumber, score: $score, change: $change}';
}
ScoreEntry.fromJson(Map<String, dynamic> json)
: roundNumber = json['roundNumber'],