getEcoscoreHtmlDescription static method
- @Deprecated('Use getProduct with ecoscore fields instead')
- String barcode,
- OpenFoodFactsLanguage language, {
- QueryType? queryType,
Returns the Ecoscore description in HTML
Implementation
// TODO: deprecated from 2022-01-22; remove when old enough
@Deprecated('Use getProduct with ecoscore fields instead')
static Future<String?> getEcoscoreHtmlDescription(
final String barcode,
final OpenFoodFactsLanguage language, {
final QueryType? queryType,
}) async {
try {
final ProductResult productResult = await getProduct(
ProductQueryConfiguration(
barcode,
language: language,
country: null,
fields: [ProductField.ENVIRONMENT_INFOCARD],
version: ProductQueryVersion.v0,
),
user: null,
queryType: queryType,
);
return productResult.product?.environmentInfoCard;
} catch (e) {
return null;
}
}