PIbd31_Razubaev.S.M._PMU/lib/data/dtos/mangas_dto.dart
2024-10-16 12:08:15 +04:00

49 lines
1.2 KiB
Dart

import 'package:json_annotation/json_annotation.dart';
part 'mangas_dto.g.dart';
@JsonSerializable(createToJson: false)
class MangasDto {
final List<MangaDataDto>? data;
const MangasDto({this.data});
factory MangasDto.fromJson(Map<String, dynamic> json) =>
_$MangasDtoFromJson(json);
}
@JsonSerializable(createToJson: false)
class MangaDataDto {
final String? id;
final String? type;
final String? title;
final String? status;
final double? score;
final int? scored_by;
final MangaDataImagesDto? images;
const MangaDataDto(this.title, this.status, this.score, this.scored_by, this.images, {this.id, this.type});
factory MangaDataDto.fromJson(Map<String, dynamic> json) =>
_$MangaDataDtoFromJson(json);
}
@JsonSerializable(createToJson: false)
class MangaDataImagesDto {
final MangaDataImagesJPGDto? jpg;
const MangaDataImagesDto({this.jpg});
factory MangaDataImagesDto.fromJson(Map<String, dynamic> json) =>
_$MangaDataImagesDtoFromJson(json);
}
@JsonSerializable(createToJson: false)
class MangaDataImagesJPGDto {
final String? image_url;
const MangaDataImagesJPGDto({this.image_url});
factory MangaDataImagesJPGDto.fromJson(Map<String, dynamic> json) =>
_$MangaDataImagesJPGDtoFromJson(json);
}