TusUploadManager class

Manager for handling multiple TUS uploads

Constructors

TusUploadManager({required Uri serverUrl, required TusStore store, int defaultChunkSize = 5 * 1024 * 1024, int maxConcurrentUploads = 3, bool autoStart = true, bool measureUploadSpeed = true, bool preventDuplicates = true, int retries = 3, RetryScale retryScale = RetryScale.exponential, int retryInterval = 2, bool debug = false})
Constructor

Properties

autoStart bool
Whether to automatically start uploads when added (default: true)
final
debug bool
Debug flag for verbose logging
final
defaultChunkSize int
Default chunk size for all uploads in bytes (default: 5MB)
final
hashCode int
The hash code for this object.
no setterinherited
maxConcurrentUploads int
Maximum concurrent uploads (default: 3)
final
measureUploadSpeed bool
Whether to measure upload speed for better time estimates (default: true)
final
preventDuplicates bool
Whether to prevent duplicate uploads (default: true)
final
retries int
Retry settings for failed uploads
final
retryInterval int
final
retryScale RetryScale
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serverUrl Uri
TUS server endpoint URL
final
store TusStore
Store for persisting upload information
final
uploadEvents Stream<UploadEvent>
no setter

Methods

addUpload(XFile file, {Map<String, String>? metadata, Map<String, String>? headers, int? chunkSize}) Future<String>
Add a new file for upload Returns the ID of the managed upload
cancelAll() Future<void>
Cancel all uploads
cancelUpload(String id) Future<bool>
dispose() → void
Clean up resources
getAllUploads() List<ManagedUpload>
Get all managed uploads
getFingerprintForId(String uploadId) String?
Get the fingerprint for an upload by its ID Returns null if the upload ID is not found
getIdByFingerprint(String fingerprint) String?
Find an upload ID by its fingerprint If multiple uploads have the same fingerprint (same file uploaded multiple times), returns the most recently added one
getUpload(String id) ManagedUpload?
Get a specific upload by ID
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pauseAll() Future<void>
Pause all active uploads
pauseUpload(String id) Future<bool>
Pause an upload
resumeAll() Future<void>
Resume all paused uploads
resumeUpload(String id) Future<void>
Resume a paused upload
startUpload(String id) Future<void>
Start a specific upload by ID
toString() String
A string representation of this object.
inherited

Operators

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