import 'package:json_annotation/json_annotation.dart'; part 'anime_dto.g.dart'; @JsonSerializable(createToJson: false) class AnimesDto { final List? data; const AnimesDto({this.data}); factory AnimesDto.fromJson(Map json) => _$AnimesDtoFromJson(json); } @JsonSerializable(createToJson: false) class AnimeDataDto { @JsonKey(name: 'mal_id') final int? id; final String? title; final String? synopsis; final double? score; final AnimeImagesDto? images; const AnimeDataDto(this.id, this.title, this.synopsis, this.images, this.score); factory AnimeDataDto.fromJson(Map json) => _$AnimeDataDtoFromJson(json); } @JsonSerializable(createToJson: false) class AnimeImagesDto { final AnimeImagesJpgDto? jpg; const AnimeImagesDto({this.jpg}); factory AnimeImagesDto.fromJson(Map json) => _$AnimeImagesDtoFromJson(json); } @JsonSerializable(createToJson: false) class AnimeImagesJpgDto { @JsonKey(name: 'image_url') final String? image; @JsonKey(name: 'small_image_url') final String? smallImage; @JsonKey(name: 'large_image_url') final String? largeImage; const AnimeImagesJpgDto(this.image, this.smallImage, this.largeImage); factory AnimeImagesJpgDto.fromJson(Map json) => _$AnimeImagesJpgDtoFromJson(json); }