toJson method
Implementation
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['cost'] = this.cost;
data['fling_power'] = this.flingPower;
if (this.flingEffect != null) {
data['fling_effect'] = this.flingEffect!.toJson();
}
if (this.attributes != null) {
data['attributes'] = this.attributes!.map((v) => v.toJson()).toList();
}
if (this.category != null) {
data['category'] = this.category!.toJson();
}
if (this.effectEntries != null) {
data['effect_entries'] =
this.effectEntries!.map((v) => v.toJson()).toList();
}
if (this.flavorTextEntries != null) {
data['flavor_text_entries'] =
this.flavorTextEntries!.map((v) => v.toJson()).toList();
}
if (this.gameIndices != null) {
data['game_indices'] = this.gameIndices!.map((v) => v.toJson()).toList();
}
if (this.names != null) {
data['names'] = this.names!.map((v) => v.toJson()).toList();
}
if (this.sprites != null) {
data['sprites'] = this.sprites!.toJson();
}
if (this.heldByPokemon != null) {
data['held_by_pokemon'] =
this.heldByPokemon!.map((v) => v.toJson()).toList();
}
if (this.babyTriggerFor != null) {
data['baby_trigger_for'] = this.babyTriggerFor!.toJson();
}
return data;
}