2024-10-16 12:08:15 +04:00
|
|
|
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
|
|
|
|
part 'mangas_dto.g.dart';
|
|
|
|
|
|
|
|
@JsonSerializable(createToJson: false)
|
|
|
|
class MangasDto {
|
|
|
|
final List<MangaDataDto>? data;
|
2024-10-16 14:37:36 +04:00
|
|
|
final MangaPaginationDto? pagination;
|
|
|
|
const MangasDto({this.data, this.pagination});
|
2024-10-16 12:08:15 +04:00
|
|
|
|
|
|
|
factory MangasDto.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$MangasDtoFromJson(json);
|
|
|
|
}
|
2024-10-16 14:37:36 +04:00
|
|
|
@JsonSerializable(createToJson: false)
|
|
|
|
class MangaPaginationDto {
|
|
|
|
@JsonKey(name: 'current_page')
|
|
|
|
final int? currentPage;
|
|
|
|
@JsonKey(name: 'has_next_page')
|
|
|
|
final bool? hasNextPage;
|
|
|
|
@JsonKey(name: 'last_visible_page')
|
|
|
|
final int? lastVisiblePage;
|
|
|
|
|
|
|
|
const MangaPaginationDto({this.currentPage, this.hasNextPage, this.lastVisiblePage});
|
|
|
|
|
|
|
|
factory MangaPaginationDto.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$MangaPaginationDtoFromJson(json);
|
|
|
|
}
|
2024-10-16 12:08:15 +04:00
|
|
|
|
|
|
|
@JsonSerializable(createToJson: false)
|
|
|
|
class MangaDataDto {
|
2024-10-17 16:31:39 +04:00
|
|
|
@JsonKey(name: "mal_id")
|
|
|
|
final int? id;
|
2024-10-16 12:08:15 +04:00
|
|
|
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);
|
|
|
|
}
|