I have successfully pushed data into firebase firestore and trying to get it back , but facing some issues with that . i would appreciate any help , Thank you
- This is my attempt
void getDrivers(){
geoFlutterFire = Geoflutterfire();
GeoFirePoint geoFirePoint = GeoFirePoint(latitude, longitude);
var ref = _firebaseFirestore.collection('Drivers');
var locations = geoFlutterFire.collection(collectionRef: ref)
.within(center: geoFirePoint, radius: maxRadius, field: 'position');
locations.listen((List<DocumentSnapshot> documentList) {
for (var documentSnapshot in documentList) {
Map<String,Object> documentShot = documentSnapshot.get('geopoint');
dynamic lat = documentShot['Latitude'];
dynamic lon = documentShot['Longitude'];
markers.add(Marker(
markerId: MarkerId(DateTime.now().millisecond.toString()),
position: LatLng(lat,lon),
icon: BitmapDescriptor.defaultMarker
));
Fluttertoast.showToast(msg: 'markers Size ' + markers.length.toString());
}
});
}
PS : error points to this line : documentSnapshot.get('geopoint');

