toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = Map<String, dynamic>();
  data['game_index'] = this.gameIndex;
  if (this.names != null) {
    data['names'] = this.names!.map((v) => v.toJson()).toList();
  }
  if (this.pokemonEncounters != null) {
    data['pokemon_encounters'] =
        this.pokemonEncounters!.map((v) => v.toJson()).toList();
  }
  data['name'] = this.name;
  if (this.location != null) {
    data['location'] = this.location!.toJson();
  }
  data['id'] = this.id;
  if (this.encounterMethodRates != null) {
    data['encounter_method_rates'] =
        this.encounterMethodRates!.map((v) => v.toJson()).toList();
  }
  return data;
}