getProductIndex method

int getProductIndex(
  1. String productId,
  2. List<ProductVariant> variants
)

getProductIndex will return the specific item index

Implementation

int getProductIndex(
  String productId,
  List<ProductVariant> variants,
) {
  var itemIndex = _cartItemsList.indexWhere((item) =>
      item.productId == productId &&
      _areVariantsEqual(item.variants, variants));

  return itemIndex;
}