Skip to content

Instantly share code, notes, and snippets.

@emiliodallatorre
Created November 2, 2023 09:54
Show Gist options
  • Save emiliodallatorre/2ff10fe2bee09dd27f8fa828b52417c5 to your computer and use it in GitHub Desktop.
Save emiliodallatorre/2ff10fe2bee09dd27f8fa828b52417c5 to your computer and use it in GitHub Desktop.
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