- Starting with version 3.0.0, we now enforce all clients to provide a valid user agent. For this, please ensure to set the SDK before using any other functionality:
OpenFoodAPIConfiguration.userAgent = UserAgent(
name: '<Name of your app>',
);-
QueryTypehas been deleted. Now, for API calls you have to provide aUriProductHelperparameter. By default it will point you to openfoodfacts/prod. -
For
RobotoffAPIClient.getRandomInsightsandRobotoffAPIClient.getQuestions, a list of countries instead of a single country as parameter. -
Use
OpenFoodFactsCountry.fromOffTaginstead ofCountryHelper.fromJson. -
OpenFoodAPIClient.getOrderedNutrientsnow uses aOpenFoodFactsCountryparameter instead of a 2-letter country code. -
Methods
getProductImageRootUrlandgetBarcodeSubPathare moved toUriProductHelperfromImageHelper -
Method
buildUrlrenamed asgetLocalizedProductImageUrlinImageHelper -
Removal of deprecated code.
- Now the only entry point is
import 'package:openfoodfacts/openfoodfacts.dart';- replace all your instances of
import 'package:openfoodfacts/...';with a singleimport 'package:openfoodfacts/openfoodfacts.dart';
- replace all your instances of
- If you used
Statefromproduct_state.dart, you have to rename it toProductState - If you used
Levelfromnutrient_levels.dart, you have to rename it toNutrientLevel - Removed deprecated classes:
PageProductListQueryConfigurationToBeCompletedConfiguration
- Removed deprecated fields and methods in
Nutriments- all the single nutrient value fields were removed - use
getValueandsetValueinstead - instead of
getUnitusenutrient.typicalUnit
- all the single nutrient value fields were removed - use