I am implementing a project in Flutter firebase. In the application, it sends the locations of the places traveled by the user while the user is moving to the firestore database. I also want to get these locations from the database again, but I can't get the geopoints codes. I came across an input called "Instance of 'Geopoints' ". What I want is to get longtitude and latitude as coordinates in the input section that says "Instance of 'Geopoints'". For example (52.2165157N, 6.94378199E)
The piece of code we retrieved from the database:
getData() async {
FirebaseFirestore.instance
.collection('Test')
.where(('Liste'), arrayContains: "kosum1")
.get()
.then((value) {
value.docs.forEach((result) {
print(result.data().values.toString());
});
});}
The piece of code we recorded in the database:
dataBaseSave() async {
final User user = auth.currentUser;
await _geolocator
.getCurrentPosition(desiredAccuracy: LocationAccuracy.high)
.then((Position position) {
setState(() {
_currentPosition = position;
GeoFirePoint point = geo.point(
latitude: position.latitude, longitude: position.longitude);
FirebaseFirestore.instance.collection('Test').add({
'Liste': FieldValue.arrayUnion([nb1, kosuadi, user.uid, point.data])
});
nb1++;
});
});}



You'll have to dig a little more into the data to get the information back.
resultis going to be an array that holds strings (index 0-2) and an object. That object looks like it has an instance of your GeoPoint. When you access that Geopoint you should be able to domyGeopoint.latitudeandmyGeopoint.longitudeto get the two points. This is not exact, but it should look something likeresult.data().values[3].geopoint.longitudeand same for longitude.