Added toString method + default values
This commit is contained in:
@@ -1,13 +1,14 @@
|
|||||||
class ScoreEntry {
|
class ScoreEntry {
|
||||||
int roundNumber = 0;
|
final int roundNumber;
|
||||||
final int score;
|
final int score;
|
||||||
final int change;
|
final int change;
|
||||||
|
|
||||||
ScoreEntry({
|
ScoreEntry({required this.score, this.roundNumber = 0, this.change = 0});
|
||||||
required this.roundNumber,
|
|
||||||
required this.score,
|
@override
|
||||||
required this.change,
|
String toString() {
|
||||||
});
|
return 'ScoreEntry{roundNumber: $roundNumber, score: $score, change: $change}';
|
||||||
|
}
|
||||||
|
|
||||||
ScoreEntry.fromJson(Map<String, dynamic> json)
|
ScoreEntry.fromJson(Map<String, dynamic> json)
|
||||||
: roundNumber = json['roundNumber'],
|
: roundNumber = json['roundNumber'],
|
||||||
|
|||||||
Reference in New Issue
Block a user