toMap method

Map<String, dynamic> toMap({
  1. bool withId = true,
})

Get a json map from this geo point

withId include the id of the geo point or not

Implementation

Map<String, dynamic> toMap({bool withId = true}) {
  final json = <String, dynamic>{
    "name": name,
    "timestamp": timestamp,
    "latitude": latitude,
    "longitude": longitude,
    "altitude": altitude,
    "speed": speed,
    "heading": heading,
    "accuracy": accuracy,
    "speed_accuracy": speedAccuracy,
    "number": number,
    "street": street,
    "locality": locality,
    "sublocality": sublocality,
    "postal_code": postalCode,
    "subregion": subregion,
    "region": region,
    "country": country,
  };
  if (withId) json["id"] = id;
  return json;
}