saveInCacheStatus function
Implementation
Future<void> saveInCacheStatus(String id, String status) async {
// do {
// await Future.delayed(Duration(seconds: 2));
// }while (ordersDataCache.isEmpty);
// for (var item in ordersDataCache)
// if (item.id == id){
// item.status = status;
// FirebaseFirestore.instance.collection("cache").doc("orders")
// .set({
// item.id: item.toJson(),
// }, SetOptions(merge: true));
// break;
// }
var t = await bookingGetItem(OrderDataCache.createEmpty(id));
if (t == null){
if (currentOrder.id.isNotEmpty){
OrderDataCache _cache = _bookingSaveInCache(currentOrder);
_cache.status = status;
FirebaseFirestore.instance.collection("cache").doc("orders")
.set({
_cache.id: _cache.toJson(),
}, SetOptions(merge: true));
}
}
}