LocationArea.fromJson constructor
LocationArea.fromJson(
- Map<String, dynamic> json
)
Implementation
LocationArea.fromJson(Map<String, dynamic> json) {
gameIndex = json['game_index'];
if (json['names'] != null) {
names = <LocationAreaName>[];
(json['names'] as List).forEach((v) {
names!.add(LocationAreaName.fromJson(v));
});
}
if (json['pokemon_encounters'] != null) {
pokemonEncounters = <LocationAreaPokemonEncounter>[];
(json['pokemon_encounters'] as List).forEach((v) {
pokemonEncounters!.add(LocationAreaPokemonEncounter.fromJson(v));
});
}
name = json['name'];
location = json['location'] != null
? NamedAPIResource.fromJson(json['location'])
: null;
id = json['id'];
if (json['encounter_method_rates'] != null) {
encounterMethodRates = <LocationAreaEncounterMethodRate>[];
(json['encounter_method_rates'] as List).forEach((v) {
encounterMethodRates!.add(LocationAreaEncounterMethodRate.fromJson(v));
});
}
}