isProductExists method

Future<GeneralResponse<ProductDetails>> isProductExists(
  1. String barcode
)

Implementation

Future<GeneralResponse<ProductDetails>> isProductExists(
    String barcode) async {
  return loadResponse(() async {
    final response = await _api.isProductExists(barcode);
    if (response.data != null) {
      return ProductDetails.fromJson(response.data);
    }
    throw Exception('Product not found');
  });
}