0
votes

I hope you are all doing well. I have a bit of a problem here with flutter (v2.8.1) on my windows. I am trying to use StreamBuilder class to fetch data from firebase but it is not working anyhow. I tried to use BuildContext context but it is still throwing me error on context. Please have a look at my code and let me know what I am doing wrong. Answers are appreciated. Thanks in advance.

StreamBuilder(builder: (BuildContext context, snapshot), stream: _firestore.collection('messages').snapshots()),

Error : The argument type 'Type' can't be assigned to the parameter type 'Widget Function(BuildContext, AsyncSnapshot<QuerySnapshot<Map<String, dynamic>>>)'.

Please check the image : https://imgur.com/a/QJs6hS9

1

1 Answers

0
votes

Your StreamBuilder type needs to match your Stream type.

StreamBuilder<QuerySnapshot<Map<String, dynamic>>>(
  builder: ...
),