Lance Olana
Lance Olana

Reputation: 241

How to write geopoint data in firebase firestore in Flutter?

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

I just want to simply store latitue and longitude data

Upvotes: 0

Views: 631

Answers (1)

triple7
triple7

Reputation: 883

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

Upvotes: 3

Related Questions