gogoboom_flutter_core library

Classes

ApiError
BaseDio
BaseError
BaseOptions
The common config for the Dio instance. dio.options is a instance of BaseOptions
Body
Use this annotation on a service method param when you want to directly control the request body of a POST/PUT request (instead of sending in as request parameters or form-style request body).
CacheControl
CancelRequest
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.
CoreConfig
DefaultTransformer
DELETE
Make a DELETE request
Dio
A powerful Http client for Dart, which supports Interceptors, Global configuration, FormData, File downloading etc. and Dio is very easy to use.
DioMixin
DioOptions
DioResponseType
ErrorInterceptorHandler
Handler for error interceptor.
Extra
Extra data that will be passed to dio's request, response, transformer and interceptors.
Field
Named pair for a form request.
FormData
A class to create readable "multipart/form-data" streams. It can be used to submit forms and file uploads to http server.
FormUrlEncoded
Denotes that the request body will use form URL encoding. Fields should be declared as parameters and annotated with Field.
GET
Make a GET request
Make a HEAD request
Replaces the header with the value of its target.
Headers
Adds headers specified in the value map.
HttpClientAdapter
HttpAdapter is a bridge between Dio and HttpClient.
HttpMethod
A holder that includes all http methods which are supported by retrofit.
HttpResponse<T>
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:
ListParam<T>
Lock
Add lock/unlock API for interceptors.
LogInterceptor
LogInterceptor is used to print logs during network requests. It's better to add LogInterceptor to the tail of the interceptor queue, otherwise the changes made in the interceptor behind A will not be printed out. This is because the execution of interceptors is in the order of addition.
Method
MultiPart
Denotes that the request body is multi-part. Parts should be declared as parameters and annotated with Part.
MultipartFile
A file to be uploaded as part of a MultipartRequest. This doesn't need to correspond to a physical file.
NeedAuth
NeedLogin
NetworkError
NoBody
Use this annotation on a service method param when you want to indicate that no body should be generated for POST/PUT/DELETE requests.
OPTIONS
Make a OPTIONS request
Options
Every request can pass an Options object which will be merged with Dio.options
OtherError
Part
Denotes a single part of a multi-part request. Part parameters may not be null.
PATCH
Make a PATCH request
Path
Named replacement in a URL path segment.
POST
Make a POST request
PUT
Make a PUT request
PwdEmpty
PwdNotMatch
Queries
Query parameter keys and values appended to the URL.
Query
Query parameter appended to the URL.
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:
ReceiveProgress
RedirectRecord
RequestInterceptorHandler
Handler for request interceptor.
RequestOptions
Response<T>
Response describes the http Response info.
ResponseBody
ResponseInterceptorHandler
Handler for response interceptor.
RestApi
Define an API.
SendProgress
Transformer
Transformer allows changes to the request/response data before it is sent/received to/from the server.
UserNameEmpty
UserNotExist

Enums

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.
Parser
Define how to parse response json If you want to support more, PR is welcome
Profiles
ResponseType
ResponseType indicates which transformation should be automatically applied to the response data by Dio.

Mixins

OptionsMixin

Properties

coreConfig CoreConfig
getter/setter pair
dio Dio
final

Typedefs

HeaderForEachCallback = void Function(String name, List<String> values)
InterceptorErrorCallback = void Function(DioError e, ErrorInterceptorHandler handler)
InterceptorSendCallback = void Function(RequestOptions options, RequestInterceptorHandler handler)
InterceptorSuccessCallback = void Function(Response e, ResponseInterceptorHandler handler)
JsonDecodeCallback = dynamic Function(String)
The default Transformer for Dio. If you want to custom the transformation of request/response data, you can provide a Transformer by your self, and replace the DefaultTransformer by setting the dio.Transformer.
ProgressCallback = void Function(int count, int total)
Callback to listen the progress for sending/receiving data.
RequestEncoder = List<int> Function(String request, RequestOptions options)
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.