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

39 lines
1.3 KiB
Dart
Raw Normal View History

2024-10-14 21:25:43 +04:00
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'pokemon_dto.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
PokemonDto _$PokemonDtoFromJson(Map<String, dynamic> json) => PokemonDto(
2024-10-29 14:36:44 +04:00
results: (json['results'] as List<dynamic>?)
2024-10-18 21:36:44 +04:00
?.map((e) => PokemonDataDto.fromJson(e as Map<String, dynamic>))
.toList(),
2024-10-29 14:36:44 +04:00
count: (json['count'] as num?)?.toInt(),
next: json['next'] as String?,
previous: json['previous'] as String?,
2024-10-14 21:25:43 +04:00
);
2024-10-18 21:36:44 +04:00
PokemonDataDto _$PokemonDataDtoFromJson(Map<String, dynamic> json) =>
PokemonDataDto(
id: json['id'] as String?,
2024-10-29 14:36:44 +04:00
name: json['name'] as String?,
2024-10-18 21:36:44 +04:00
attributes: json['attributes'] == null
? null
2024-10-29 14:36:44 +04:00
: PokemonAttributesDto.fromJson(
2024-10-18 21:36:44 +04:00
json['attributes'] as Map<String, dynamic>),
);
2024-10-29 14:36:44 +04:00
PokemonAttributesDto _$PokemonAttributesDtoFromJson(
2024-10-18 21:36:44 +04:00
Map<String, dynamic> json) =>
2024-10-29 14:36:44 +04:00
PokemonAttributesDto(
type: json['type'] as String?,
height: (json['height'] as num?)?.toInt(),
weight: (json['weight'] as num?)?.toInt(),
abilities: (json['abilities'] as List<dynamic>?)
?.map((e) => e as String)
.toList(),
2024-10-18 21:36:44 +04:00
image: json['image'] as String?,
);