TransientFile class

Transient Files, for an immediate local access before actual upload.

Available extensions

Constructors

TransientFile(ImageField imageField, String barcode, OpenFoodFactsLanguage language, [DateTime? uploadedDate])
TransientFile.fromProduct(Product product, ImageField imageField, OpenFoodFactsLanguage language)
factory
TransientFile.fromProductImageData(ProductImageData productImageData, String barcode, OpenFoodFactsLanguage language, [DateTime? uploadedDate])

Properties

barcode → String
final
expired → bool

Available on TransientFile, provided by the TransientFileExtension extension

no setter
hashCode → int
The hash code for this object.
no setterinherited
imageField → ImageField
final
language → OpenFoodFactsLanguage
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
uploadedDate → DateTime?
final
url → String?
final

Methods

getImage() → File?
Returns the File stored locally.
getImageProvider() → ImageProvider<Object>?
Returns a way to display the image, either locally or from the server.
isImageAvailable() → bool
Returns true if an image is available, locally or on the server.
isServerImage() → bool
Returns true if the displayed image comes from the server.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
putImage(LocalDatabase localDatabase, File file) → void
Stores locally file as a transient image for imageField and barcode.
removeImage(LocalDatabase localDatabase) → void
Removes the current transient image for imageField and barcode.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

getImageLanguages(ImageField imageField, String barcode) → Iterable<OpenFoodFactsLanguage>
Returns the languages that have currently transient images.