status method

  1. @override
Future<FileUploadStatusResponse> status(
  1. FileUploadPresentationResponse presentation
)

the method that, given the presentation id, allows requesting the file's state.

The file's state will return FileUploadStatusResponse. This is needed to support retrying from the last unsent chunk.

presentation is the response of the present method.

controller.retry(); // under the hood status is called and the upload is retried from the last unsent chunk

Implementation

@override
Future<FileUploadStatusResponse> status(
  FileUploadPresentationResponse presentation,
) {
  return _client
      .request<dynamic>(
        statusPath(presentation),
        cancelToken: cancelToken,
        data: statusBody,
        options: dio.Options(
          method: statusMethod,
          headers: statusHeaders?.call(presentation),
        ),
      )
      .then(statusParser);
}