TusClient class

This class is used for creating or resuming uploads.

Constructors

TusClient(Uri url, XFile file, {TusStore? store, Map<String, String>? headers, Map<String, String>? metadata = const {}, int maxChunkSize = 512 * 1024})

Properties

file → XFile
final
fingerprint String
The fingerprint of the file being uploaded
no setter
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>?
Any additional headers
final
maxChunkSize int
The maximum payload size in bytes when uploading the file in chunks (512KB)
final
metadata Map<String, String>?
final
resumingEnabled bool
Whether the client supports resuming
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
store TusStore?
Storage used to save and retrieve upload URLs by its fingerprint.
final
uploadMetadata String
The 'Upload-Metadata' header sent to server
no setter
uploadUrl Uri?
The URI on the server for the file
no setter
url Uri
The tus server Uri
final

Methods

create() → dynamic
Create a new upload throwing ProtocolException on server error
generateFingerprint() String?
Override this method to customize creating file fingerprint
generateMetadata() String
Override this to customize creating 'Upload-Metadata'
getHttpClient() → Client
Override this method to use a custom Client
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onComplete() → void
Actions to be performed after a successful upload
pause() → dynamic
Pause the current upload
resume() Future<bool>
Check if possible to resume an already started upload
toString() String
A string representation of this object.
inherited
upload({dynamic onProgress(double)?, dynamic onComplete()?}) → dynamic
Start or resume an upload in chunks of maxChunkSize throwing ProtocolException on server error

Operators

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

Static Properties

tusVersion String
Version of the tus protocol used by the client. The remote server needs to support this version, too.
final