toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data =  Map<String, dynamic>();
  data['id'] = this.id;
  data['name'] = this.name;
  data['base_experience'] = this.baseExperience;
  data['height'] = this.height;
  data['is_default'] = this.isDefault;
  data['order'] = this.order;
  data['weight'] = this.weight;
  if (this.abilities != null) {
    data['abilities'] = this.abilities!.map((v) => v.toJson()).toList();
  }
  if (this.forms != null) {
    data['forms'] = this.forms!.map((v) => v.toJson()).toList();
  }
  if (this.gameIndices != null) {
    data['game_indices'] = this.gameIndices!.map((v) => v.toJson()).toList();
  }
  if (this.heldItems != null) {
    data['held_items'] = this.heldItems!.map((v) => v.toJson()).toList();
  }
  if (this.moves != null) {
    data['moves'] = this.moves!.map((v) => v.toJson()).toList();
  }
  if (this.species != null) {
    data['species'] = this.species!.toJson();
  }
  if (this.sprites != null) {
    data['sprites'] = this.sprites!.toJson();
  }
  if (this.stats != null) {
    data['stats'] = this.stats!.map((v) => v.toJson()).toList();
  }
  if (this.types != null) {
    data['types'] = this.types!.map((v) => v.toJson()).toList();
  }
  return data;
}