ProductImage class
Product image. Can be "main" (e.g. "front_fr") or "raw" (e.g. "picture #9").
For "main" images the key is field + language + size. For "raw" images the key is the imgid + size.
We have limited data for "raw" images, like "this is the nth image for this product". We have more data for "main" images, like "we built this image from that raw image with this crop parameters and angle".
Constructors
- ProductImage({required ImageField field, ImageSize? size, required OpenFoodFactsLanguage language, String? url, int? rev, String? imgid, ImageAngle? angle, String? coordinatesImageSize, int? x1, int? y1, int? x2, int? y2, int? width, int? height})
- ProductImage.raw({ImageSize? size, String? url, required String imgid, int? width, int? height, DateTime? uploaded})
Properties
- angle ↔ ImageAngle?
-
Image angle, compared to the uploaded image
getter/setter pair
- coordinatesImageSize ↔ String?
-
On what size are the coordinates (x1, ...)computed? 'full' or '400'
getter/setter pair
- field → ImageField?
-
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- height ↔ int?
-
Image height.
getter/setter pair
- imgid ↔ String?
-
Uploaded image id (probably an
int
)getter/setter pair - isMain → bool
-
no setter
- language → OpenFoodFactsLanguage?
-
final
- rev ↔ int?
-
Revision number
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → ImageSize?
-
final
- uploaded ↔ DateTime?
-
Upload timestamp, for uploaded images only, in seconds since Unix Epoch.
getter/setter pair
- url ↔ String?
-
getter/setter pair
- width ↔ int?
-
Image width.
getter/setter pair
- x1 ↔ int?
-
Crop coordinate x1, compared to the uploaded image
getter/setter pair
- x2 ↔ int?
-
Crop coordinate x2, compared to the uploaded image
getter/setter pair
- y1 ↔ int?
-
Crop coordinate y1, compared to the uploaded image
getter/setter pair
- y2 ↔ int?
-
Crop coordinate y2, compared to the uploaded image
getter/setter pair
Methods
-
getUrl(
String barcode, {ImageSize? imageSize, UriProductHelper uriHelper = uriHelperFoodProd}) → String - Returns the url to display this image.
-
getUrlFilename(
{ImageSize? imageSize}) → String - Returns just the filename of the url to display this image.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override