import 'package:json_annotation/json_annotation.dart'; part 'pokemon_dto.g.dart'; @JsonSerializable(createToJson: false) class PokemonDto { final List? data; final MetaDto? meta; const PokemonDto({ this.data, this.meta, }); factory PokemonDto.fromJson(Map json) => _$PokemonDtoFromJson(json); } @JsonSerializable(createToJson: false) class PokemonDataDto { final String? id; final String? name; final List? types; final List? evolvesTo; final PokemonImagesDto? images; const PokemonDataDto({ this.id, this.name, this.types, this.evolvesTo, this.images, }); factory PokemonDataDto.fromJson(Map json) => _$PokemonDataDtoFromJson(json); } @JsonSerializable(createToJson: false) class PokemonImagesDto { final String? small; const PokemonImagesDto({this.small}); factory PokemonImagesDto.fromJson(Map json) => _$PokemonImagesDtoFromJson(json); } @JsonSerializable(createToJson: false) class MetaDto { final PaginationDto? pagination; const MetaDto({this.pagination}); factory MetaDto.fromJson(Map json) => _$MetaDtoFromJson(json); } @JsonSerializable(createToJson: false) class PaginationDto { final int? current; final int? next; final int? last; const PaginationDto({this.current, this.next, this.last}); factory PaginationDto.fromJson(Map json) => _$PaginationDtoFromJson(json); }