I have three categories each one in a separate collection I want to display them in one list by order them by time on the home page? how to do that with firestore and flutter
Future<List<Event>> fetchEv() async {
var snap =
await evRef.orderBy('createdAt', descending: true).getDocuments();
return convertToEvModel(snap);
}
Future<List<Ads>> fetchAd() async {
var snap =
await adRef.orderBy('createdAt', descending: true).getDocuments();
return convertToAdModel(snap);
}
Future<List<Post>> fetchUserPosts() async {
var snap = await postRef
.orderBy('createdAt', descending: true)
.where('creator', isEqualTo: this.userId)
.getDocuments();
return convertToPostModel(snap);
}
i want to merge these three to one list