toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data =  Map<String, dynamic>();
  if (this.generation != null) {
    data['generation'] = this.generation!.toJson();
  }
  data['pp'] = this.pp;
  if (this.statChanges != null) {
    data['stat_changes'] = [];
  }
  data['accuracy'] = this.accuracy;
  if (this.contestCombos != null) {
    data['contest_combos'] = this.contestCombos!.toJson();
  }
  data['priority'] = this.priority;
  if (this.superContestEffect != null) {
    data['super_contest_effect'] = this.superContestEffect!.toJson();
  }
  if (this.type != null) {
    data['type'] = this.type!.toJson();
  }
  if (this.effectChanges != null) {
    data['effect_changes'] = [];
  }
  if (this.target != null) {
    data['target'] = this.target!.toJson();
  }
  if (this.effectEntries != null) {
    data['effect_entries'] =
        this.effectEntries!.map((v) => v.toJson()).toList();
  }
  if (this.contestType != null) {
    data['contest_type'] = this.contestType!.toJson();
  }
  if (this.pastValues != null) {
    data['past_values'] = [];
  }
  if (this.names != null) {
    data['names'] = this.names!.map((v) => v.toJson()).toList();
  }
  if (this.meta != null) {
    data['meta'] = this.meta!.toJson();
  }
  if (this.flavorTextEntries != null) {
    data['flavor_text_entries'] =
        this.flavorTextEntries!.map((v) => v.toJson()).toList();
  }
  if (this.damageClass != null) {
    data['damage_class'] = this.damageClass!.toJson();
  }
  data['name'] = this.name;
  data['effect_chance'] = this.effectChance;
  data['id'] = this.id;
  if (this.machines != null) {
    data['machines'] = [];
  }
  data['power'] = this.power;
  if (this.contestEffect != null) {
    data['contest_effect'] = this.contestEffect!.toJson();
  }
  return data;
}