added toJson and fromJson functions
This commit is contained in:
@@ -4,4 +4,12 @@ class LatLng {
|
||||
|
||||
LatLng(this.lat, this.lng);
|
||||
LatLng.empty() : lat = 0, lng = 0;
|
||||
|
||||
factory LatLng.fromJson(Map<String, dynamic> json) {
|
||||
return LatLng(json['lat'] as double, json['lng'] as double);
|
||||
}
|
||||
|
||||
Map<String, double> toJson() {
|
||||
return {'lat': lat, 'lng': lng};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user