import 'package:json_annotation/json_annotation.dart'; part 'pokemon_dto.g.dart'; @JsonSerializable(createToJson: false) class PokemonDto { final List? data; final int? page; final int? pageSize; final int? count; final int? totalCount; const PokemonDto({ this.data, this.page, this.pageSize, this.count, this.totalCount, }); 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 List? abilities; final PokemonImagesDto? images; final String? artist; const PokemonDataDto({ this.id, this.name, this.types, this.evolvesTo, this.abilities, this.images, this.artist, }); factory PokemonDataDto.fromJson(Map json) => _$PokemonDataDtoFromJson(json); } @JsonSerializable(createToJson: false) class PokemonAbilityDto { final String? name; final String? text; final String? type; const PokemonAbilityDto({this.name, this.text, this.type}); factory PokemonAbilityDto.fromJson(Map json) => _$PokemonAbilityDtoFromJson(json); } @JsonSerializable(createToJson: false) class PokemonImagesDto { final String? large; const PokemonImagesDto({this.large}); factory PokemonImagesDto.fromJson(Map json) => _$PokemonImagesDtoFromJson(json); }