getProductRaw static method

  1. @Deprecated('Use getProductV3 instead')
Future<ProductResult> getProductRaw(
  1. String barcode,
  2. OpenFoodFactsLanguage language, {
  3. User? user,
  4. QueryType? queryType,
})

Returns the product for the given barcode. The ProductResult does not contain a product, if the product is not available. No parsing of ingredients. No adjustment by language. No replacing of '"' with '"'.

Implementation

// TODO: deprecated from 2022-12-01; remove when old enough
@Deprecated('Use getProductV3 instead')
static Future<ProductResult> getProductRaw(
  String barcode,
  OpenFoodFactsLanguage language, {
  User? user,
  QueryType? queryType,
}) async {
  final String productString = await getProductString(
    ProductQueryConfiguration(
      barcode,
      language: language,
      country: null,
      fields: null,
    ),
    user: user,
    queryType: queryType,
  );
  return ProductResult.fromJson(json.decode(productString));
}