toMap method

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() {
  final map = <String, dynamic>{};
  // we have nullables so defaults values are respected
  if (autocomplete != null) map['autocomplete'] = autocomplete.toString();
  if (bbox != null) {
    map['bbox'] =
        bbox != null ? bbox!.map((value) => value.toString()) : null;
  }
  if (country != null) map['country'] = country;
  if (fuzzyMatch != null) map['fuzzyMatch'] = fuzzyMatch.toString();
  if (language != null) map['language'] = language;
  if (limit != null) map['limit'] = limit.toString();
  if (proximity != null) map['proximity'] = proximity!.toParamStr();
  if (routing != null) map['routing'] = routing.toString();
  if (types != null) map['types'] = types!.map((type) => type.name).toList();
  if (worldview != null) map['worldview'] = worldview;
  return map;
}