import 'package:json_annotation/json_annotation.dart'; part 'pokemon_dto.g.dart'; @JsonSerializable(createToJson: false) class PokemonDto { final int id; final String name; final List types; final PokemonSpritesDto sprites; const PokemonDto({ required this.id, required this.name, required this.types, required this.sprites, }); factory PokemonDto.fromJson(Map json) => _$PokemonDtoFromJson(json); } @JsonSerializable(createToJson: false) class PokemonTypeDto { final int slot; final PokemonTypeDetailDto type; const PokemonTypeDto({ required this.slot, required this.type, }); factory PokemonTypeDto.fromJson(Map json) => _$PokemonTypeDtoFromJson(json); } @JsonSerializable(createToJson: false) class PokemonTypeDetailDto { final String name; final String url; const PokemonTypeDetailDto({ required this.name, required this.url, }); factory PokemonTypeDetailDto.fromJson(Map json) => _$PokemonTypeDetailDtoFromJson(json); } @JsonSerializable(createToJson: false) class PokemonSpritesDto { final String front_default; const PokemonSpritesDto({ required this.front_default, }); factory PokemonSpritesDto.fromJson(Map json) => _$PokemonSpritesDtoFromJson(json); }