PIbd-32_Chubykina_P.P._mobilki/lib/data/dtos/pokemon_dto.dart

33 lines
701 B
Dart

import 'package:json_annotation/json_annotation.dart';
part 'pokemon_dto.g.dart';
@JsonSerializable(createToJson: false)
class PokemonDto {
final List<PokemonDataDto>? results;
final int? count;
final String? next;
final String? previous;
const PokemonDto({
this.results,
this.count,
this.next,
this.previous,
});
factory PokemonDto.fromJson(Map<String, dynamic> json) => _$PokemonDtoFromJson(json);
}
@JsonSerializable(createToJson: false)
class PokemonDataDto {
final String? name;
final String? url;
const PokemonDataDto({
this.name,
this.url,
});
factory PokemonDataDto.fromJson(Map<String, dynamic> json) => _$PokemonDataDtoFromJson(json);
}