DioRestorableChunkedFileHandler class
DioRestorableChunkedFileHandler handle the file upload in chunk with the capability to retry the upload from the last chunk sent.
- Inheritance
-
- Object
- SocketRestorableChunkedFileHandler<
Response> - DioRestorableChunkedFileHandler
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}) -
clientused to upload the fileconst
Properties
- cancelToken → CancelToken?
-
Controls cancellation of
dio.Dio's requests.final - chunkBody → String?
-
bodyused on chunk uploadfinalinherited - chunkHeaders → RestorableChunkHeadersCallback?
-
headersused on chunk uploadfinalinherited - chunkMethod → String
-
methodused on chunk uploadfinalinherited -
chunkParser
→ ChunkParser<
Response> -
callback to validate chunk upload
finalinherited
- chunkPath → ChunkPathCallback
-
pathused on chunk uploadfinalinherited - chunkSize → int?
-
chunk size, if null
defaultChunkSizeis usedfinalinherited - 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?
-
bodyused on presentationfinalinherited -
presentHeaders
→ Map<
String, String> ? -
headersused on presentationfinalinherited - presentHeadersCallback → PresentHeadersCallback?
-
headersused on presentationfinalinherited - presentMethod → String
-
methodused on presentationfinalinherited -
presentParser
→ PresentParser<
Response> -
callback to convert
ResponseTypeintoFileUploadPresentationResponsefinalinherited - presentPath → String
-
pathused on presentationfinalinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- statusBody → String?
-
bodyused on statusfinalinherited - statusHeaders → StatusHeadersCallback?
-
headersused on statusfinalinherited - statusMethod → String
-
methodused on statusfinalinherited -
statusParser
→ StatusParser<
Response> -
callback to convert
ResponseTypeintoFileUploadStatusResponsefinalinherited - statusPath → StatusPathCallback
-
pathused on statusfinalinherited
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