YustFile class
A binary file handled by database and file storage. A file is stored in Firebase Storeage and linked to a document in the database. For offline caching a file can also be stored on the device.
- Annotations
-
- @JsonSerializable()
Constructors
- YustFile({String? key, String? name, DateTime? modifiedAt, String? url, String hash = '', File? file, Uint8List? bytes, String? devicePath, String? storageFolderPath, String? linkedDocPath, String? linkedDocAttribute, bool processing = false, String? lastError})
-
YustFile.fromJson(Map<
String, dynamic> json) -
Converts the file to JSON for Firebase. Only relevant attributs are converted.
factory
-
YustFile.fromLocalJson(Map<
String, dynamic> json) -
Converts the file to JSON for local device. Only relevant attributs are converted.
factory
Properties
- bytes ↔ Uint8List?
-
The binary file for web. For iOS and Android file is used instead.
getter/setter pair
- cacheable → bool
-
True if image can be stored in cache. Each cached file needs a name
no setter
- cached → bool
-
True if image is cached locally.
no setter
- devicePath ↔ String?
-
Path to the file on the device. Used for offline caching.
getter/setter pair
- file ↔ File?
-
The binary file. This attibute is used for iOS and Android. For web bytes is used instead.
getter/setter pair
- hash ↔ String
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- key ↔ String?
-
getter/setter pair
- lastError ↔ String?
-
stores the last error. Used in offline caching
getter/setter pair
- linkedDocAttribute ↔ String?
-
Attribute of the Firebase document. Used for offline caching.
getter/setter pair
- linkedDocPath ↔ String?
-
Path to the Firebase document. Used for offline caching.
getter/setter pair
- modifiedAt ↔ DateTime?
-
The name of the file with extension.
getter/setter pair
- name ↔ String?
-
The name of the file with extension.
getter/setter pair
- processing ↔ bool
-
Is true while uploading the file.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- storageFolderPath ↔ String?
-
Path to the storage folder. Used for offline caching.
getter/setter pair
- url ↔ String?
-
The URL to download the file.
getter/setter pair
Methods
-
getFilenameExtension(
) → String -
getFileNameWithoutExtension(
) → String -
isValid(
) → bool -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts JSON from Firebase to a file. Only relevant attributs are included.
-
toLocalJson(
) → Map< String, String?> - Converts JSON from device to a file. Only relevant attributs are included.
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
YustFile file) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited