UploadJob class

Represents a file upload job with chunked upload support

This class contains all the information needed to upload a file in chunks, including file path, upload URL, chunk size, and various callbacks for progress tracking and status updates.

Annotations
  • @HiveType.new(typeId: 0)

Constructors

UploadJob({required String id, required String filePath, required String url, int chunkSize = 1024 * 1024, HeaderBuilder? headerBuilder, ProgressCallback? onProgress, int maxRetries = 3, int retryCount = 0, UploadJobStatus status = UploadJobStatus.pending, UploadCompleteCallback? onComplete, UploadFailedCallback? onFailed, int priority = 0, bool isPaused = false, bool isManuallyPaused = false})
Creates a new upload job
UploadJob.fromJson(Map<String, dynamic> json)
factory

Properties

box → BoxBase?
Get the box in which this object is stored. Returns null if object has not been added to a box yet.
no setterinherited
chunkSize int
Size of each chunk in bytes (default: 1MB)
getter/setter pair
filePath String
Path to the file to be uploaded
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
headerBuilder HeaderBuilder?
Optional function to build custom headers for each chunk
getter/setter pair
id String
Unique identifier for the upload job
getter/setter pair
isInBox bool
Returns whether this object is currently stored in a box.
no setterinherited
isManuallyPaused bool
Whether the job was manually paused by the user (vs automatically paused due to connectivity loss)
getter/setter pair
isPaused bool
Whether the job is currently paused
getter/setter pair
key → dynamic
Get the key associated with this object. Returns null if object has not been added to a box yet.
no setterinherited
maxRetries int
Maximum number of retry attempts before marking as failed
getter/setter pair
onComplete UploadCompleteCallback?
Callback function for successful completion
getter/setter pair
onFailed UploadFailedCallback?
Callback function for failures
getter/setter pair
onProgress ProgressCallback?
Callback function for progress updates
getter/setter pair
priority int
Priority level for queue ordering (higher = higher priority)
getter/setter pair
progress double
Current upload progress (0.0 to 1.0)
getter/setter pair
retryCount int
Number of retry attempts made for this job
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status UploadJobStatus
Current status of the upload job
getter/setter pair
url String
URL where the file chunks will be uploaded
getter/setter pair

Methods

delete() Future<void>
Deletes this object from the box it is stored in.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
save() Future<void>
Persists this object.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

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