Created
November 2, 2023 09:54
-
-
Save emiliodallatorre/2ff10fe2bee09dd27f8fa828b52417c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:cloud_firestore/cloud_firestore.dart'; | |
import 'package:geoflutterfire2/geoflutterfire2.dart'; | |
class LocationHelper { | |
static Map<String, dynamic> geoFirePointToJson(final GeoFirePoint? geoFirePoint) { | |
return geoFirePoint?.data; | |
} | |
static GeoFirePoint? geoFirePointFromJson(final Map<String, dynamic>? json) { | |
if (json == null) { | |
return null; | |
} | |
final GeoPoint geoPoint = json["geopoint"] as GeoPoint; | |
return GeoFirePoint(geoPoint.latitude, geoPoint.longitude); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment