Removed matchId from Score class
This commit is contained in:
@@ -49,7 +49,6 @@ class ScoreDao extends DatabaseAccessor<AppDatabase> with _$ScoreDaoMixin {
|
|||||||
|
|
||||||
return Score(
|
return Score(
|
||||||
playerId: result.playerId,
|
playerId: result.playerId,
|
||||||
matchId: result.matchId,
|
|
||||||
roundNumber: result.roundNumber,
|
roundNumber: result.roundNumber,
|
||||||
score: result.score,
|
score: result.score,
|
||||||
change: result.change,
|
change: result.change,
|
||||||
@@ -64,7 +63,6 @@ class ScoreDao extends DatabaseAccessor<AppDatabase> with _$ScoreDaoMixin {
|
|||||||
.map(
|
.map(
|
||||||
(row) => Score(
|
(row) => Score(
|
||||||
playerId: row.playerId,
|
playerId: row.playerId,
|
||||||
matchId: row.matchId,
|
|
||||||
roundNumber: row.roundNumber,
|
roundNumber: row.roundNumber,
|
||||||
score: row.score,
|
score: row.score,
|
||||||
change: row.change,
|
change: row.change,
|
||||||
@@ -86,7 +84,6 @@ class ScoreDao extends DatabaseAccessor<AppDatabase> with _$ScoreDaoMixin {
|
|||||||
.map(
|
.map(
|
||||||
(row) => Score(
|
(row) => Score(
|
||||||
playerId: row.playerId,
|
playerId: row.playerId,
|
||||||
matchId: row.matchId,
|
|
||||||
roundNumber: row.roundNumber,
|
roundNumber: row.roundNumber,
|
||||||
score: row.score,
|
score: row.score,
|
||||||
change: row.change,
|
change: row.change,
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
class Score {
|
class Score {
|
||||||
final String playerId;
|
final String playerId;
|
||||||
final String matchId;
|
|
||||||
final int roundNumber;
|
final int roundNumber;
|
||||||
int score = 0;
|
int score = 0;
|
||||||
int change = 0;
|
int change = 0;
|
||||||
|
|
||||||
Score({
|
Score({
|
||||||
required this.playerId,
|
required this.playerId,
|
||||||
required this.matchId,
|
|
||||||
required this.roundNumber,
|
required this.roundNumber,
|
||||||
required this.score,
|
required this.score,
|
||||||
required this.change,
|
required this.change,
|
||||||
@@ -15,14 +13,12 @@ class Score {
|
|||||||
|
|
||||||
Score.fromJson(Map<String, dynamic> json)
|
Score.fromJson(Map<String, dynamic> json)
|
||||||
: playerId = json['playerId'],
|
: playerId = json['playerId'],
|
||||||
matchId = json['matchId'],
|
|
||||||
roundNumber = json['roundNumber'],
|
roundNumber = json['roundNumber'],
|
||||||
score = json['score'],
|
score = json['score'],
|
||||||
change = json['change'];
|
change = json['change'];
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
'playerId': playerId,
|
'playerId': playerId,
|
||||||
'matchId': matchId,
|
|
||||||
'roundNumber': roundNumber,
|
'roundNumber': roundNumber,
|
||||||
'score': score,
|
'score': score,
|
||||||
'change': change,
|
'change': change,
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ void main() {
|
|||||||
|
|
||||||
expect(score, isNotNull);
|
expect(score, isNotNull);
|
||||||
expect(score!.playerId, testPlayer1.id);
|
expect(score!.playerId, testPlayer1.id);
|
||||||
expect(score.matchId, testMatch1.id);
|
|
||||||
expect(score.roundNumber, 1);
|
expect(score.roundNumber, 1);
|
||||||
expect(score.score, 10);
|
expect(score.score, 10);
|
||||||
expect(score.change, 10);
|
expect(score.change, 10);
|
||||||
|
|||||||
Reference in New Issue
Block a user