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? type; final PokemonAttributesDataDto? attributes; const PokemonDataDto({this.id, this.type, this.attributes}); factory PokemonDataDto.fromJson(Map json) => _$PokemonDataDtoFromJson(json); } @JsonSerializable(createToJson: false) class PokemonAttributesDataDto { final String? name; final String? height; final String? weight; final String? image; const PokemonAttributesDataDto({ this.name, this.height, this.weight, this.image, }); factory PokemonAttributesDataDto.fromJson(Map json) => _$PokemonAttributesDataDtoFromJson(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); }