getSpecificProduct method

CartModel? getSpecificProduct(
  1. String productId,
  2. List<ProductVariant> variants
)

getSpecificProduct will return the specific item from cart

Implementation

CartModel? getSpecificProduct(
  String productId,
  List<ProductVariant> variants,
) {
  var itemIndex = getProductIndex(productId, variants);
  if (itemIndex != -1) {
    return _cartItemsList[itemIndex];
  }
  return null;
}