Skip to content

Commit

Permalink
Merge pull request #28 from canopas/Mayank/refactor-team-detail-screen
Browse files Browse the repository at this point in the history
Refactor team detail screen
  • Loading branch information
cp-mayank authored May 31, 2024
2 parents 348facb + afb1224 commit f33c38c
Show file tree
Hide file tree
Showing 11 changed files with 1,016 additions and 570 deletions.
26 changes: 25 additions & 1 deletion data/lib/api/match/match_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class AddMatchTeamRequest with _$AddMatchTeamRequest {
required String team_id,
String? captain_id,
String? admin_id,
@Default(0) double over,
@Default(0) double over,
@Default(0) int run,
@Default(0) int wicket,
@Default([]) List<MatchPlayerRequest> squad,
Expand Down Expand Up @@ -209,3 +209,27 @@ enum TossDecision {

const TossDecision(this.value);
}

@freezed
class TeamMatchStatus with _$TeamMatchStatus {
const factory TeamMatchStatus({
@Default(0) int win,
@Default(0) int tie,
@Default(0) int lost,
}) = _TeamMatchStatus;
}

@freezed
class TeamStat with _$TeamStat {
const factory TeamStat({
@Default(0) int played,
@Default(TeamMatchStatus()) TeamMatchStatus status,
@Default(0) int runs,
@Default(0) int wickets,
@Default(0.0) double bating_average,
@Default(0.0) double bowling_average,
@Default(0) int highest_runs,
@Default(0) int lowest_runts,
@Default(0.0) double run_rate,
}) = _TeamStat;
}
Loading

0 comments on commit f33c38c

Please sign in to comment.