refreshRelations static method

Future<MemberCartModel> refreshRelations(
  1. MemberCartModel model
)

Implementation

static Future<MemberCartModel> refreshRelations(MemberCartModel model) async {
  List<CartItemModel>? cartItemsHolder;
  if (model.cartItems != null) {
    cartItemsHolder = List<CartItemModel>.from(
            await Future.wait(model.cartItems!.map((element) async {
      return await CartItemCache.refreshRelations(element);
    })))
        .toList();
  }

  return model.copyWith(
    cartItems: cartItemsHolder,
  );
}