toMap method

Map<String, dynamic> toMap()

Implementation

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