import 'package:json_annotation/json_annotation.dart'; part 'pokemon_dto.g.dart'; @JsonSerializable(createToJson: false) class PokemonDto { final String? name; final int? baseExperience; final List? types; final List? abilities; final PokemonSpritesDto? sprites; const PokemonDto({ this.name, this.baseExperience, this.types, this.abilities, this.sprites, }); factory PokemonDto.fromJson(Map json) => _$PokemonDtoFromJson(json); } @JsonSerializable(createToJson: false) class PokemonTypeDto { final int? slot; final TypeDto? type; const PokemonTypeDto({this.slot, this.type}); factory PokemonTypeDto.fromJson(Map json) => _$PokemonTypeDtoFromJson(json); } @JsonSerializable(createToJson: false) class TypeDto { final String? name; final String? url; const TypeDto({this.name, this.url}); factory TypeDto.fromJson(Map json) => _$TypeDtoFromJson(json); } @JsonSerializable(createToJson: false) class PokemonAbilityDto { final int? slot; final AbilityDto? ability; const PokemonAbilityDto({this.slot, this.ability}); factory PokemonAbilityDto.fromJson(Map json) => _$PokemonAbilityDtoFromJson(json); } @JsonSerializable(createToJson: false) class AbilityDto { final String? name; final String? url; const AbilityDto({this.name, this.url}); factory AbilityDto.fromJson(Map json) => _$AbilityDtoFromJson(json); } @JsonSerializable(createToJson: false) class PokemonSpritesDto { final String front_default; const PokemonSpritesDto({ required this.front_default, }); factory PokemonSpritesDto.fromJson(Map json) => _$PokemonSpritesDtoFromJson(json); }