streamData method
Implementation
Stream<QuerySnapshot> streamData({
required String collection,
String? collectionChild,
String? idChild,
bool isErrorDialog = true,
Function(String? message)? onError,
}) {
if (collectionChild == null && idChild == null) {
return _firestore
.collection(collection)
// .orderBy("dateCreated", descending: true)
.snapshots();
} else {
return _firestore
.collection(collection)
.doc(idChild)
.collection(collectionChild!)
// .orderBy("dateCreated", descending: true)
.snapshots();
}
}