DioRestorableChunkedFileHandler class

DioRestorableChunkedFileHandler handle the file upload in chunk with the capability to retry the upload from the last chunk sent.

Inheritance

Constructors

DioRestorableChunkedFileHandler({required Dio client, required XFile file, required String presentPath, required ChunkPathCallback chunkPath, required StatusPathCallback statusPath, required PresentParser<Response> presentParser, required StatusParser<Response> statusParser, String presentMethod = kPresentMethod, String chunkMethod = kChunkMethod, String statusMethod = kStatusMethod, Map<String, String>? presentHeaders, RestorableChunkHeadersCallback? chunkHeaders, StatusHeadersCallback? statusHeaders, String? presentBody, String? chunkBody, String? statusBody, int? chunkSize, String fileKey = kFileKey, ChunkParser<Response> chunkParser = kChunkParser, PresentHeadersCallback? presentHeadersCallback, CancelToken? cancelToken})
client used to upload the file
const

Properties

cancelToken → CancelToken?
Controls cancellation of dio.Dio's requests.
final
chunkBody String?
body used on chunk upload
finalinherited
chunkHeaders RestorableChunkHeadersCallback?
headers used on chunk upload
finalinherited
chunkMethod String
method used on chunk upload
finalinherited
chunkParser → ChunkParser<Response>
callback to validate chunk upload
finalinherited
chunkPath ChunkPathCallback
path used on chunk upload
finalinherited
chunkSize int?
chunk size, if null defaultChunkSize is used
finalinherited
file → XFile
The file to upload.
no setterinherited
fileKey String
request key for file
finalinherited
hashCode int
The hash code for this object.
no setterinherited
originalFile → XFile
The file to upload.
finalinherited
presentBody String?
body used on presentation
finalinherited
presentHeaders Map<String, String>?
headers used on presentation
finalinherited
presentHeadersCallback PresentHeadersCallback?
headers used on presentation
finalinherited
presentMethod String
method used on presentation
finalinherited
presentParser → PresentParser<Response>
callback to convert ResponseType into FileUploadPresentationResponse
finalinherited
presentPath String
path used on presentation
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusBody String?
body used on status
finalinherited
statusHeaders StatusHeadersCallback?
headers used on status
finalinherited
statusMethod String
method used on status
finalinherited
statusParser → StatusParser<Response>
callback to convert ResponseType into FileUploadStatusResponse
finalinherited
statusPath StatusPathCallback
path used on status
finalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
present(XFile file) Future<FileUploadPresentationResponse>
the method to present the file; before uploading the chunks, the file is presented and needs FileUploadPresentationResponse.
status(FileUploadPresentationResponse presentation) Future<FileUploadStatusResponse>
the method that, given the presentation id, allows requesting the file's state.
toString() String
A string representation of this object.
inherited
uploadChunk(FileUploadPresentationResponse presentation, FileChunk chunk, {ProgressCallback? onProgress}) Future<void>
method to handle the upload of a FileChunk.

Operators

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