2024-12-11 00:13:44 +04:00

74 lines
2.1 KiB
Dart

import 'package:json_annotation/json_annotation.dart';
part 'players_dto.g.dart';
@JsonSerializable(createToJson: false)
class PlayersDto {
final List<PlayerDataDto>? items;
final PaginationDto? pagination;
const PlayersDto({
this.items,
this.pagination,
});
factory PlayersDto.fromJson(Map<String, dynamic> json) => _$PlayersDtoFromJson(json);
}
@JsonSerializable(createToJson: false)
class PlayerDataDto {
final int? id;
final String? firstName;
final String? lastName;
final String? commonName;
final int? overallRating;
final int? skillMoves;
final int? weakFootAbility;
final PlayerNationalityDataDto? nationality;
final PlayerTeamDataDto? team;
final PlayerPositionDataDto? position;
final String? avatarUrl;
final String? shieldUrl;
const PlayerDataDto({this.id, this.firstName, this.lastName, this.commonName, this.overallRating, this.skillMoves, this.weakFootAbility, this.nationality, this.team, this.position, this.avatarUrl, this.shieldUrl});
factory PlayerDataDto.fromJson(Map<String, dynamic> json) => _$PlayerDataDtoFromJson(json);
}
@JsonSerializable(createToJson: false)
class PlayerNationalityDataDto {
final String? label;
final String? imageUrl;
const PlayerNationalityDataDto(this.label, this.imageUrl);
factory PlayerNationalityDataDto.fromJson(Map<String, dynamic> json) => _$PlayerNationalityDataDtoFromJson(json);
}
@JsonSerializable(createToJson: false)
class PlayerTeamDataDto {
final String? label;
final String? imageUrl;
const PlayerTeamDataDto(this.label, this.imageUrl);
factory PlayerTeamDataDto.fromJson(Map<String, dynamic> json) => _$PlayerTeamDataDtoFromJson(json);
}
@JsonSerializable(createToJson: false)
class PlayerPositionDataDto {
final String? label;
const PlayerPositionDataDto(this.label);
factory PlayerPositionDataDto.fromJson(Map<String, dynamic> json) => _$PlayerPositionDataDtoFromJson(json);
}
@JsonSerializable(createToJson: false)
class PaginationDto {
final int? offset;
const PaginationDto({this.offset});
factory PaginationDto.fromJson(Map<String, dynamic> json) => _$PaginationDtoFromJson(json);
}