A wrapper interface for serializing/deserializing TransportableFile data to/from a Map.
The serialized Map follows this structure:
{
"data": "<base64-encoded file content>", // From [TransportableData]
"filename": "photo.png", // Original file name
"URL": "http://example.com/photo.png", // Remote CDN URL (alternative to `data`)
"key": { // Symmetric decryption key (for encrypted CDN content)
"algorithm": "AES", // Encryption algorithm (e.g., "AES", "DES")
"data": "<base64-encoded key data>" // Key material (base64 encoded)
}
}
Key notes:
dataandURLare mutually exclusive for large files (preferURLto reduce payload size)keyis required only if the CDN-hosted content is encrypted
- Implementers
Properties
- data ↔ TransportableData?
-
Binary file data (encoded as TransportableData).
getter/setter pair
- filename ↔ String?
-
Original filename of the file (e.g., "avatar.png").
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- password ↔ DecryptKey?
-
Symmetric decryption key for encrypted file content from url.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- url ↔ Uri?
-
Remote CDN URL to download the file (alternative to data for large files).
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → MutableMapping - Converts the wrapper's state to a structured Map (matches the format defined in this class).
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
create(
Mapping content, {TransportableData? data, String? filename, Uri? url, DecryptKey? password}) → TransportableFileWrapper