'how to get through 'Future<List<QuerySnapshot<Map<String, dynamic>>>> and get data
I have a list of type 'Future<List<QuerySnapshot<Map<String, dynamic>>>>
that looks like this,
var postlist = FirebaseFirestore.instance.collection('posts').orderBy("datePublished", descending: true).where('uid', whereIn: theUserData['following']).snapshots().toList();
and i want it to go through post list and get data, how? and thank you in advance!! <3
Solution 1:[1]
Maybe you get an error when you equal it to variable. I think you should use as List<QuerySnapshot<Map<String, dynamic>>> keyword or some things like that I don't sure right now but Let's say I have a function Future<List<QuerySnapshot<Map<String, dynamic>>>> getDataFun(){...} So you can
List<QuerySnapshot<Map<String,
dynamic>>> my data = await
getDataFun() as List<QuerySnapshot<Map<String,
dynamic>>>;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Hekim Huseyin |