Here's what you're doing wrong,
- This isn't javaScript, the way you use arrow syntax is different,
Either do this
(value){
...
}
or use this if your function has only one line
(value) => print(value);
In dart just {}
will be treated like the data structure Set
hence, in this case, you're assigning the function to a Set, hence the error.
Other pointers:-
You're calling a for loop on the QuerySnapshot which is wrong because you're fetching a single document and not a collection of documents.
the way you access a key in the latest version of firebase plugin is this way
doc.data()['name']
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…