added toJson and fromJson functions

This commit is contained in:
2026-06-12 12:11:41 +02:00
parent 35f26112af
commit 1bb9fdbb18
3 changed files with 63 additions and 0 deletions
+8
View File
@@ -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};
}
}