2024-12-08 17:22:35 +04:00
|
|
|
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
|
|
|
|
part 'players_dto.g.dart';
|
|
|
|
|
|
|
|
@JsonSerializable(createToJson: false)
|
|
|
|
class PlayersDto {
|
|
|
|
final List<PlayerDataDto>? items;
|
|
|
|
|
2024-12-11 00:13:44 +04:00
|
|
|
const PlayersDto({
|
|
|
|
this.items,
|
|
|
|
});
|
2024-12-08 17:22:35 +04:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|