fetch function
dynamic
fetch(
- dynamic table, [
- dynamic cond
Implementation
fetch(table, [cond]) async {
Query<Map<String, dynamic>> tempString =
FirebaseFirestore.instance.collection(table);
if (cond == null) {
tempString = FirebaseFirestore.instance.collection(table);
} else {
tempString = FirebaseFirestore.instance.collection(table);
cond.forEach((key, value) {
tempString = tempString.where(key, isEqualTo: value);
});
}
var tempData = await tempString.get();
return tempData.docs;
}