added toJson and fromJson functions
This commit is contained in:
1 parent
35f26112af
commit
1bb9fdbb18
3 files changed
+63
No files matched your search
@@ -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