-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a28406
commit c9ca341
Showing
47 changed files
with
7,021 additions
and
648 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// ignore_for_file: non_constant_identifier_names | ||
|
||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
||
part 'ball_score_model.freezed.dart'; | ||
|
||
part 'ball_score_model.g.dart'; | ||
|
||
@freezed | ||
class BallScoreModel with _$BallScoreModel { | ||
const factory BallScoreModel({ | ||
String? id, | ||
required String inning_id, | ||
required int over_number, | ||
required int ball_number, | ||
required String bowler_id, | ||
required String batsman_id, | ||
int? runs_scored, | ||
ExtrasType? extras_type, | ||
int? extras_awarded, | ||
WicketType? wicket_type, | ||
String? player_out_id, | ||
String? wicket_taker_id, | ||
required bool is_four, | ||
required bool is_six, | ||
required DateTime time, | ||
}) = _BallScoreModel; | ||
|
||
factory BallScoreModel.fromJson(Map<String, dynamic> json) => _$BallScoreModelFromJson(json); | ||
|
||
} | ||
|
||
@JsonEnum(valueField: "value") | ||
enum ExtrasType { | ||
wide(1), | ||
noBall(2), | ||
bye(3), | ||
legBye(4), | ||
penaltyRun(5); | ||
|
||
final int value; | ||
|
||
const ExtrasType(this.value); | ||
} | ||
|
||
@JsonEnum(valueField: "value") | ||
enum WicketType { | ||
bowled(1), | ||
caught(2), | ||
caughtBehind(3), | ||
caughtAndBowled(4), | ||
lbw(5), | ||
stumped(6), | ||
runOut(7), | ||
hitWicket(8), | ||
hitBallTwice(9), | ||
handledBall(10), | ||
obstructingField(11), | ||
timedOut(12), | ||
retired(13), | ||
retiredHurt(14); | ||
|
||
final int value; | ||
|
||
const WicketType(this.value); | ||
} |
Oops, something went wrong.