getOrderedNutrients static method

Future<OrderedNutrients> getOrderedNutrients({
  1. required String cc,
  2. required OpenFoodFactsLanguage language,
  3. QueryType? queryType,
})

Returns the nutrient hierarchy specific to a country, localized.

cc is the country code, as ISO 3166-1 alpha-2

Implementation

static Future<OrderedNutrients> getOrderedNutrients({
  required final String cc,
  required final OpenFoodFactsLanguage language,
  final QueryType? queryType,
}) async =>
    OrderedNutrients.fromJson(
      jsonDecode(
        await getOrderedNutrientsJsonString(
          country: CountryHelper.fromJson(cc)!,
          language: language,
        ),
      ),
    );