I am trying to get simply a document from my firebase collection
but i get this error: Unhandled Exception: PlatformException(Error 5, FIRFirestoreErrorDomain, No document to update
I have a document with the document id i checked it by printing
and this is my code:
void updateBalanceOfSender() async {
var docID;
Firestore.instance
.collection('balance')
.where('user', isEqualTo: loggedInUser.email)
.snapshots()
.listen((data) =>
data.documents.forEach((doc) => print(docID = doc.documentID)));
_firestore
.collection('balance')
.document(docID)
.updateData({'balance': '1'});
}