fromCartResponse static method

List<ProductEntity> fromCartResponse({
  1. required CartResponse? response,
})

Implementation

static List<ProductEntity> fromCartResponse({
  required CartResponse? response,
}) =>
    <ProductEntity>[
      ...response?.productsRemoved
              ?.map(
                (ProductResponse productResponse) =>
                    ProductMapper.fromCartResponse(
                  productResponse: productResponse,
                  cartResponse: response,
                  isRemoved: true,
                ),
              )
              .toList() ??
          <ProductEntity>[],
      ...response?.products
              ?.map(
                (ProductResponse productResponse) =>
                    ProductMapper.fromCartResponse(
                  productResponse: productResponse,
                  cartResponse: response,
                ),
              )
              .toList() ??
          <ProductEntity>[],
    ];