DioMixin class abstract

Implemented types

Constructors

DioMixin()

Properties

hashCode int
The hash code for this object.
no setterinherited
httpClientAdapter HttpClientAdapter
The adapter that the instance is using.
getter/setter pairoverride
interceptors Interceptors
Each Dio instance has a interceptor group by which you can intercept requests or responses before they are ended.
no setteroverride
options BaseOptions
The base request config for the instance.
getter/setter pairoverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
transformer Transformer
The default Transformer that transfers requests and responses into corresponding content to send. For response bodies greater than 50KB, a new Isolate will be spawned to decode the response body to JSON. Taken from https://github.com/flutter/flutter/blob/135454af32477f815a7525073027a3ff9eff1bfd/packages/flutter/lib/src/services/asset_bundle.dart#L87-L93 50 KB of data should take 2-3 ms to parse on a Moto G4, and about 400 μs on a Pixel 4.
getter/setter pairoverride

Methods

close({bool force = false}) → void
Shuts down the dio client.
override
delete<T>(String path, {Object? data, Map<String, dynamic>? queryParameters, Options? options, CancelToken? cancelToken}) Future<Response<T>>
Convenience method to make an HTTP DELETE request.
override
deleteUri<T>(Uri uri, {Object? data, Options? options, CancelToken? cancelToken}) Future<Response<T>>
Convenience method to make an HTTP DELETE request with Uri.
override
download(String urlPath, dynamic savePath, {ProgressCallback? onReceiveProgress, Map<String, dynamic>? queryParameters, CancelToken? cancelToken, bool deleteOnError = true, String lengthHeader = Headers.contentLengthHeader, Object? data, Options? options}) Future<Response>
Download the file and save it in local. The default http method is "GET", you can custom it by Options.method.
override
downloadUri(Uri uri, dynamic savePath, {ProgressCallback? onReceiveProgress, CancelToken? cancelToken, bool deleteOnError = true, String lengthHeader = Headers.contentLengthHeader, Object? data, Options? options}) Future<Response>
Download the file and save it in local. The default http method is "GET", you can custom it by Options.method.
override
fetch<T>(RequestOptions requestOptions) Future<Response<T>>
The eventual method to submit requests. All callers for requests should eventually go through this method.
override
get<T>(String path, {Map<String, dynamic>? queryParameters, Object? data, Options? options, CancelToken? cancelToken, ProgressCallback? onReceiveProgress}) Future<Response<T>>
Convenience method to make an HTTP GET request.
override
getUri<T>(Uri uri, {Object? data, Options? options, CancelToken? cancelToken, ProgressCallback? onReceiveProgress}) Future<Response<T>>
Convenience method to make an HTTP GET request with Uri.
override
Convenience method to make an HTTP HEAD request.
override
headUri<T>(Uri uri, {Object? data, Options? options, CancelToken? cancelToken}) Future<Response<T>>
Convenience method to make an HTTP HEAD request with Uri.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
patch<T>(String path, {Object? data, Map<String, dynamic>? queryParameters, Options? options, CancelToken? cancelToken, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<T>>
Convenience method to make an HTTP PATCH request.
override
patchUri<T>(Uri uri, {Object? data, Options? options, CancelToken? cancelToken, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<T>>
Convenience method to make an HTTP PATCH request with Uri.
override
post<T>(String path, {Object? data, Map<String, dynamic>? queryParameters, Options? options, CancelToken? cancelToken, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<T>>
Convenience method to make an HTTP POST request.
override
postUri<T>(Uri uri, {Object? data, Options? options, CancelToken? cancelToken, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<T>>
Convenience method to make an HTTP POST request with Uri.
override
put<T>(String path, {Object? data, Map<String, dynamic>? queryParameters, Options? options, CancelToken? cancelToken, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<T>>
Convenience method to make an HTTP PUT request.
override
putUri<T>(Uri uri, {Object? data, Options? options, CancelToken? cancelToken, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<T>>
Convenience method to make an HTTP PUT request with Uri.
override
request<T>(String path, {Object? data, Map<String, dynamic>? queryParameters, CancelToken? cancelToken, Options? options, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<T>>
Make HTTP request with options.
override
requestUri<T>(Uri uri, {Object? data, CancelToken? cancelToken, Options? options, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<T>>
Make http request with options with Uri.
override
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

assureDioException(Object error, RequestOptions requestOptions) DioException
assureResponse<T>(Object response, RequestOptions requestOptions) Response<T>
checkCancelled(CancelToken? cancelToken) → void
checkOptions(String method, Options? options) Options
listenCancelForAsyncTask<T>(CancelToken? cancelToken, Future<T> future) Future<T>