import 'package:json_annotation/json_annotation.dart'; part "animes_dto.g.dart"; @JsonSerializable(createToJson: false) class AnimesDto { final List? data; final PaginationDto? pagination; const AnimesDto({this.data, this.pagination}); factory AnimesDto.fromJson(Map json) => _$AnimesDtoFromJson(json); } @JsonSerializable(createToJson: false) class PaginationDto { @JsonKey(name: 'last_visible_page') final int? lastPage; @JsonKey(name: 'has_next_page') final bool? hasNextPage; @JsonKey(name: 'current_page') final int? currentPage; const PaginationDto({this.currentPage, this.hasNextPage, this.lastPage}); factory PaginationDto.fromJson(Map json) => _$PaginationDtoFromJson(json); } @JsonSerializable(createToJson: false) class AnimeDto { @JsonKey(name: "mal_id") final int? id; final String? title; final int? year; final String? type; final String? synopsis; final String? rating; final ImagesDto? images; const AnimeDto( {this.id, this.title, this.rating, this.synopsis, this.type, this.year, this.images}); factory AnimeDto.fromJson(Map json) => _$AnimeDtoFromJson(json); } @JsonSerializable(createToJson: false) class ImagesDto { final ImageDto? jpg; const ImagesDto({this.jpg}); factory ImagesDto.fromJson(Map json) => _$ImagesDtoFromJson(json); } @JsonSerializable(createToJson: false) class ImageDto { @JsonKey(name: "image_url") final String? imageUrl; const ImageDto({this.imageUrl}); factory ImageDto.fromJson(Map json) => _$ImageDtoFromJson(json); }