TwkFile class
Represents a file (image, video, document) from the Tawakkalna SDK.
This model handles both base64-encoded file data and its binary representation. Files can be obtained from camera, gallery, or file picker methods.
Example:
final photo = await twk.getCameraPhoto();
if (photo != null) {
print('File: ${photo.fileName}');
print('Type: ${photo.mimeType}');
// Use photo.binary for raw bytes
// Use photo.data for base64 string
}
Properties
- binary → Uint8List
-
Binary representation of the file
final
- data → String
-
TODO:(TWK-team): as per as support team, data here is not Base64-encoded
Base64-encoded file data (without data URI prefix)
final
- fileName → String
-
The file name
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- mimeType → String
-
MIME type (e.g., "image/jpeg", "video/mp4", "application/pdf")
final
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringify → bool?
-
If set to
true, thetoStringmethod will be overridden to output this instance'sprops.no setterinherited - type → String
-
The file type (e.g., "image", "video", "document")
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited