GrowthRate.fromJson constructor
GrowthRate.fromJson(
- Map<String, dynamic> json
)
Implementation
GrowthRate.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
formula = json['formula'];
if (json['descriptions'] != null) {
descriptions = <Descriptions>[];
json['descriptions'].forEach((v) {
descriptions!.add( Descriptions.fromJson(v));
});
}
if (json['levels'] != null) {
levels = <Levels>[];
json['levels'].forEach((v) {
levels!.add( Levels.fromJson(v));
});
}
if (json['pokemon_species'] != null) {
pokemonSpecies = <NamedAPIResource>[];
json['pokemon_species'].forEach((v) {
pokemonSpecies!.add( NamedAPIResource.fromJson(v));
});
}
}