How to write geopoint data in firebase firestore in Flutter?

545 Views Asked by At

How to write GeoPoints data like this in Firebase Firestore in Flutter? Firestore

I just want to simply store latitue and longitude data

1

There are 1 best solutions below

0
On

There's a GeoPoint type provided by the Flutter Firebase library. You just do this:

final result = await FirebaseFirestore.instance
  .collection('waypoints')
  .add({
    'startPoint': GeoPoint(5.373982, 2.705164)
  });