added toJson and fromJson functions

This commit is contained in:
marco committed 2026-06-12 12:11:41 +02:00
1 parent 35f26112af
commit 1bb9fdbb18
3 files changed
+63

No files matched your search

+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};
}
}