Product class
This class contains most of the data about a specific product.
Please read the language mechanics explanation if you intend to display or update data in specific language: https://github.com/openfoodfacts/openfoodfacts-dart/blob/master/DOCUMENTATION.md#about-languages-mechanics
- Inheritance
-
- Object
- JsonObject
- Product
- Annotations
-
- @JsonSerializable()
Constructors
-
Product({String? barcode, String? productName, Map<
OpenFoodFactsLanguage, String> ? productNameInLanguages, String? genericName, String? brands, List<String> ? brandsTags, String? countries, List<String> ? countriesTags, Map<OpenFoodFactsLanguage, List< ? countriesTagsInLanguages, OpenFoodFactsLanguage? lang, String? quantity, String? imageFrontUrl, String? imageFrontSmallUrl, String? imageIngredientsUrl, String? imageIngredientsSmallUrl, String? imageNutritionUrl, String? imageNutritionSmallUrl, String? imagePackagingUrl, String? imagePackagingSmallUrl, String? servingSize, double? servingQuantity, double? packagingQuantity, List<String> >ProductImage> ? selectedImages, List<ProductImage> ? images, List<Ingredient> ? ingredients, String? ingredientsText, Map<OpenFoodFactsLanguage, String> ? ingredientsTextInLanguages, List<String> ? ingredientsTags, Map<OpenFoodFactsLanguage, List< ? ingredientsTagsInLanguages, IngredientsAnalysisTags? ingredientsAnalysisTags, Additives? additives, EnvironmentImpactLevels? environmentImpactLevels, Allergens? allergens, NutrientLevels? nutrientLevels, String? nutrimentEnergyUnit, String? nutrimentDataPer, String? nutriscore, String? categories, List<String> >String> ? categoriesTags, Map<OpenFoodFactsLanguage, List< ? categoriesTagsInLanguages, String? labels, List<String> >String> ? labelsTags, Map<OpenFoodFactsLanguage, List< ? labelsTagsInLanguages, @Deprecated('Use packagingS field instead') String? packaging, List<String> >String> ? packagingTags, List<String> ? miscTags, List<String> ? statesTags, List<String> ? tracesTags, List<String> ? storesTags, String? stores, List<AttributeGroup> ? attributeGroups, DateTime? lastModified, String? ecoscoreGrade, double? ecoscoreScore, EcoscoreData? ecoscoreData, Nutriments? nutriments, bool? noNutritionData}) -
Product.fromJson(Map<
String, dynamic> json) -
factory
Properties
- additives ↔ Additives?
-
getter/setter pair
- allergens ↔ Allergens?
-
getter/setter pair
-
attributeGroups
↔ List<
AttributeGroup> ? -
getter/setter pair
- barcode ↔ String?
-
getter/setter pair
- brands ↔ String?
-
getter/setter pair
-
brandsTags
↔ List<
String> ? -
getter/setter pair
- categories ↔ String?
-
getter/setter pair
-
categoriesTags
↔ List<
String> ? -
getter/setter pair
-
categoriesTagsInLanguages
↔ Map<
OpenFoodFactsLanguage, List< ?String> > -
getter/setter pair
- comparedToCategory ↔ String?
-
getter/setter pair
- countries ↔ String?
-
getter/setter pair
-
countriesTags
↔ List<
String> ? -
getter/setter pair
-
countriesTagsInLanguages
↔ Map<
OpenFoodFactsLanguage, List< ?String> > -
getter/setter pair
- created ↔ DateTime?
-
Creation timestamp. Read-only.
getter/setter pair
- creator ↔ String?
-
Creation user id. Read-only.
getter/setter pair
- ecoscoreData ↔ EcoscoreData?
-
getter/setter pair
- ecoscoreGrade ↔ String?
-
getter/setter pair
- ecoscoreScore ↔ double?
-
getter/setter pair
-
editors
↔ List<
String> ? -
Editors. Read-only.
getter/setter pair
- embCodes ↔ String?
-
getter/setter pair
- environmentImpactLevels ↔ EnvironmentImpactLevels?
-
getter/setter pair
- environmentInfoCard ↔ String?
-
getter/setter pair
- genericName ↔ String?
-
Common name
Example: Chocolate bar with milk and hazelnuts
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- imageFrontSmallUrl ↔ String?
-
getter/setter pair
- imageFrontUrl ↔ String?
-
getter/setter pair
- imageIngredientsSmallUrl ↔ String?
-
getter/setter pair
- imageIngredientsUrl ↔ String?
-
getter/setter pair
- imageNutritionSmallUrl ↔ String?
-
getter/setter pair
- imageNutritionUrl ↔ String?
-
getter/setter pair
- imagePackagingSmallUrl ↔ String?
-
getter/setter pair
- imagePackagingUrl ↔ String?
-
getter/setter pair
-
images
↔ List<
ProductImage> ? -
getter/setter pair
-
imagesFreshnessInLanguages
↔ Map<
OpenFoodFactsLanguage, Map< ?ImageField, int> > -
Images Freshness in seconds
getter/setter pair
-
ingredients
↔ List<
Ingredient> ? -
getter/setter pair
- ingredientsAnalysisTags ↔ IngredientsAnalysisTags?
-
getter/setter pair
-
ingredientsTags
↔ List<
String> ? -
getter/setter pair
-
ingredientsTagsInLanguages
↔ Map<
OpenFoodFactsLanguage, List< ?String> > -
getter/setter pair
- ingredientsText ↔ String?
-
getter/setter pair
-
ingredientsTextInLanguages
↔ Map<
OpenFoodFactsLanguage, String> ? -
getter/setter pair
- knowledgePanels ↔ KnowledgePanels?
-
getter/setter pair
- labels ↔ String?
-
getter/setter pair
-
labelsTags
↔ List<
String> ? -
getter/setter pair
-
labelsTagsInLanguages
↔ Map<
OpenFoodFactsLanguage, List< ?String> > -
getter/setter pair
- lang ↔ OpenFoodFactsLanguage?
-
getter/setter pair
- lastChecked ↔ DateTime?
-
Last check timestamp. Read-only.
getter/setter pair
- lastChecker ↔ String?
-
Last check user id. Read-only.
getter/setter pair
- lastModified ↔ DateTime?
-
Latest modification timestamp. Read-only.
getter/setter pair
- lastModifiedBy ↔ String?
-
Latest modification user id. Read-only.
getter/setter pair
- manufacturingPlaces ↔ String?
-
getter/setter pair
-
miscTags
↔ List<
String> ? -
getter/setter pair
- noNutritionData ↔ bool?
-
getter/setter pair
- novaGroup ↔ int?
-
getter/setter pair
- nutrientLevels ↔ NutrientLevels?
-
getter/setter pair
- nutrimentDataPer ↔ String?
-
Size of the product sample for "nutrition data for product as sold".
getter/setter pair
- nutrimentEnergyUnit ↔ String?
-
getter/setter pair
- nutriments ↔ Nutriments?
-
getter/setter pair
- nutriscore ↔ String?
-
getter/setter pair
- nutritionData ↔ bool?
-
Is the "nutrition data for product as sold" in the nutriment fields?
getter/setter pair
- origins ↔ String?
-
getter/setter pair
- packaging ↔ String?
-
getter/setter pair
- packagingQuantity ↔ double?
-
getter/setter pair
-
packagings
↔ List<
ProductPackaging> ? -
getter/setter pair
-
packagingTags
↔ List<
String> ? -
getter/setter pair
-
packagingTextInLanguages
↔ Map<
OpenFoodFactsLanguage, String> ? -
getter/setter pair
- productName ↔ String?
-
getter/setter pair
-
productNameInLanguages
↔ Map<
OpenFoodFactsLanguage, String> ? -
getter/setter pair
- quantity ↔ String?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
selectedImages
↔ List<
ProductImage> ? -
cause nesting is sooo cool ;)
getter/setter pair
- servingQuantity ↔ double?
-
getter/setter pair
- servingSize ↔ String?
-
getter/setter pair
-
statesTags
↔ List<
String> ? -
getter/setter pair
- stores ↔ String?
-
getter/setter pair
-
storesTags
↔ List<
String> ? -
getter/setter pair
-
tracesTags
↔ List<
String> ? -
getter/setter pair
- website ↔ String?
-
Link to the product page on the official site of the producer
getter/setter pair
Methods
-
getAttributes(
List< String> attributeIds) → Map<String, Attribute> - Returns all existing product attributes matching a list of attribute ids
-
getProductImprovements(
) → Set< ProductImprovement> - Returns all the potential improvements given the quality of the data
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toData(
) → Map< String, String> -
inherited
-
toJson(
) → Map< String, dynamic> -
override
-
toServerData(
) → Map< String, String> -
toString(
) → String -
A string representation of this object.
inherited
-
toValueString(
) → String -
Returns all values as a String separated by a hyphen
value1 - value2 - value3
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited