toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> map = <String, dynamic>{};

  void addIfNonNull(String fieldName, dynamic value) {
    if (value != null) {
      map[fieldName] = value;
    }
  }

  if (this.results != null) {
    map['results'] = List.generate(this.results!.length, (index) {
      return this.results![index].toJson();
    });
  }

  addIfNonNull('responseCode', responseCode);
  addIfNonNull('version', version);
  return map;
}