api_manager library

Classes

ApiManager
Created by Taohid on 01, March, 2020 Email: taohid32@gmail.com
ApiResponse<T>
every request will wrap its response with this contains api status, body data, and error message
BaseOptions
The common config for the Dio instance. dio.options is a instance of BaseOptions
CancelToken
You can cancel a request by using a cancel token. One token can be shared with different requests. when a token's cancel method invoked, all requests with this token will be cancelled.
Connectivity
Discover network connectivity configurations: Distinguish between WI-FI and cellular, check WI-FI status and more.
DioMixin
ErrorBody
error body of http response
ErrorInterceptorHandler
Handler for error interceptor.
FormData
A class to create readable "multipart/form-data" streams. It can be used to submit forms and file uploads to http server.
Interceptor
Dio instance may have interceptor(s) by which you can intercept requests/responses/errors before they are handled by then or catchError. See also:
Interceptors
Interceptors are a queue, and you can add any number of interceptors, All interceptors will be executed in first in first out order.
InterceptorsWrapper
InterceptorsWrapper is a helper class, which is used to conveniently create interceptor(s). See also:
Lock
Add lock/unlock API for interceptors.
MultipartFile
A file to be uploaded as part of a MultipartRequest. This doesn't need to correspond to a physical file.
Options
Every request can pass an Options object which will be merged with Dio.options
QueuedInterceptor
Serialize the request/response/error before they enter the interceptor.
QueuedInterceptorsWrapper
QueuedInterceptorsWrapper is a helper class, which is used to conveniently create QueuedInterceptor(s). See also:
RequestInterceptorHandler
Handler for request interceptor.
RequestOptions
Response<T>
Response describes the http Response info.
ResponseBody
ResponseInterceptorHandler
Handler for response interceptor.

Enums

ApiStatus
Api status state
ConnectivityResult
Connection status check result.
DioErrorType
ListFormat
ListFormat specifies the array format (a single parameter with multiple parameter or multiple parameters with the same name) and the separator for array items.
RequestType
Http request type
ResponseType
ResponseType indicates which transformation should be automatically applied to the response data by Dio.

Mixins

OptionsMixin

Typedefs

AuthTokenListener = Future<String> Function()
enable auth token checker by pass this to enableAuthTokenCheck
InterceptorErrorCallback = void Function(DioError e, ErrorInterceptorHandler handler)
InterceptorSendCallback = void Function(RequestOptions options, RequestInterceptorHandler handler)
InterceptorSuccessCallback = void Function(Response e, ResponseInterceptorHandler handler)
ProgressCallback = void Function(int count, int total)
Callback to listen the progress for sending/receiving data.
RequestEncoder = List<int> Function(String request, RequestOptions options)
ResponseBodySerializer<M> = M Function(dynamic jsonMap)
enable parsing http response using this request
ResponseDecoder = String Function(List<int> responseBytes, RequestOptions options, ResponseBody responseBody)
ValidateStatus = bool Function(int? status)

Exceptions / Errors

DioError
DioError describes the error info when request failed.