helpers/product_cards_helper
library
Functions
-
addPanelButton(String label, {required dynamic onPressed(), Widget? leadingIcon, Widget? trailingIcon, TextAlign? textAlign, EdgeInsetsGeometry? padding, BorderRadiusGeometry? borderRadius, WidgetStateProperty<double?>? elevation})
→ Widget
-
-
buildEditProductAppBar({required BuildContext context, required String title, required Product product, PreferredSizeWidget? bottom, List<Widget>? actions})
→ SmoothAppBar
-
-
buildProductSmoothCard({required Widget body, Widget? title, EdgeInsetsGeometry? titlePadding, EdgeInsetsGeometry? padding = EdgeInsets.zero, EdgeInsetsGeometry? margin = const EdgeInsets.symmetric(horizontal: SMALL_SPACE), BorderRadius? borderRadius})
→ Widget
-
A SmoothCard on Product cards using default margin and padding.
-
formatProductBrands(String brands, {String separator = ', '})
→ String
-
Correctly format word separators between words.
-
getEmptyProductImageData(ImageField imageField)
→ ProductImageData
-
-
getFilteredAttributes(AttributeGroup attributeGroup, String importance, Set<String> attributesToExcludeIfStatusIsUnknown, ProductPreferences preferences, {bool excludeMainScoreAttributes = true})
→ List<Attribute>
-
Returns the attributes that match the filter
-
getLocalizedProductImage(Product product, ImageField imageField, OpenFoodFactsLanguage language)
→ ProductImage?
-
-
getMandatoryAttributes(Product product, List<String> attributeGroupOrder, Set<String> attributesToExcludeIfStatusIsUnknown, ProductPreferences preferences)
→ List<Attribute>
-
Returns the mandatory attributes, ordered by attribute group order
-
getPopulatedAttributes(Product product, List<String> attributeIds, List<String> excludedAttributeIds)
→ List<Attribute>
-
-
getProductBrands(Product product, AppLocalizations appLocalizations)
→ String
-
-
getProductBrandsList(Product product, AppLocalizations appLocalizations)
→ List<String>
-
-
getProductImageData(Product product, ImageField imageField, OpenFoodFactsLanguage language)
→ ProductImageData
-
Returns data about the
imageField, for the language.
-
getProductImageLanguages(Product product, ImageField imageField)
→ Iterable<OpenFoodFactsLanguage>
-
Returns the languages for which
imageField has images for that product.
-
getProductMainImagesData(Product product, OpenFoodFactsLanguage language)
→ List<ProductImageData>
-
-
getProductName(Product product, AppLocalizations appLocalizations)
→ String
-
-
getProductNameAndBrands(Product product, AppLocalizations appLocalizations)
→ String
-
-
getProductNameWithLanguage(Product product, AppLocalizations appLocalizations)
→ (OpenFoodFactsLanguage, String)
-
-
getRawProductImages(Product product, ImageSize imageSize)
→ List<ProductImage>
-
Returns an id-sorted list of raw images matching the imageSize if possible.
-
getSortedAttributes(Product product, List<String> attributeGroupOrder, Set<String> attributesToExcludeIfStatusIsUnknown, ProductPreferences preferences, String importance, {bool excludeMainScoreAttributes = true})
→ List<Attribute>
-
Returns the attributes, ordered by importance desc and attribute group order