'Firestore keyword working in the code: Flutter
In the below code Firestore.instance.collection keyword gives an error. I can not understand why this error occurs help to resolve this error.
void _fetchMarkersFromDb() {
// TODO: improve this
print('_fetchMarkersFromDb() called');
***Firestore***.instance.collection('markers').getDocuments().then((docs) async {
final docLength = docs.documents.length;
final clients = List(docLength);
for (int i = 0; i < docLength; i++) {
clients[i] = docs.documents[i];
}
if (!isFirstCycle && isMyMarkerFetched) {
currentLocation = await Geolocator().getCurrentPosition();
}
_populateMarkers(clients);
});
} // fetches markers from firestore
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
