playx_network library

Classes

ApiException
BackgroundTransformer
The default Transformer for Dio.
BaseOptions
The base config for the Dio instance, used by Dio.options.
CancelToken
Controls cancellation of Dio's requests.
ConflictException
Exception that occurs when there is a conflict from the API mainly when receiving 409 error code.
DefaultApiError
Default api error model that can be received from network response. can be updated based on the response.
DefaultApiException
Exception that occurs another api exception happens.
DefaultEnglishExceptionMessage
Default client error messages. To customize your messages you can override ExceptionMessage the same way as this class and customize the messages.
Dio
Dio enables you to make HTTP requests easily.
DioForNative
Implements features for Dio on native platforms.
DioMixin
EmptyResponseException
Exception that occurs when the client receives empty response.
ErrorInterceptorHandler
The handler for interceptors to handle error occurred during the request.
ExceptionMessage
Class that can be extended to implement your own custom errors message.
FormatException
Exception that occurs when receiving format exception from Dio.
FormData
A class to create readable "multipart/form-data" streams. It can be used to submit forms and file uploads to http server.
Headers
The headers class for requests and responses.
HttpClientAdapter
HttpAdapter is a bridge between Dio and HttpClient.
Interceptor
Interceptor helps to deal with RequestOptions, Response, and DioException during the lifecycle of a request before it reaches users.
Interceptors
A Queue-Model list for Interceptors.
InterceptorsWrapper
A helper class to create interceptors in ease.
InternalServerErrorException
Exception that occurs when there's an internal server error. Can happen when the response returns status code 500.
IOHttpClientAdapter
The default HttpClientAdapter for native platforms.
ListParam<T>
Indicates a param being used as queries or form data, and how does it gets formatted.
LoggerSettings
Logger settings used to customize what should be logged by the application when performing a request.
LogInterceptor
LogInterceptor is used to print logs during network requests. It should be the last interceptor added, otherwise modifications by following interceptors will not be logged. This is because the execution of interceptors is in the order of addition.
MultipartFile
A file to be uploaded as part of a MultipartRequest. This doesn't need to correspond to a physical file.
NetworkError<T>
Generic Wrapper class that happens when an error happens.
NetworkException
Base class for handling api errors and provides suitable error messages.
NetworkResult<T>
Generic Wrapper class for the result of network response. when the network call is successful it returns NetworkSuccess. else it returns error with NetworkException.
NetworkSuccess<T>
Generic Wrapper class that happens when receiving a valid network response.
NoInternetConnectionException
Exception that occurs when there is no internet connection.
NotFoundException
Exception that occurs when receiving a not found request from api mainly when receiving 404 error code.
Options
Every request can pass an Options object which will be merged with Dio.options
PlayxNetworkClient
PlayxNetworkClient is a Wrapper around Dio that can perform api request With better error handling and easily get the result of any api request.
QueuedInterceptor
Interceptor in queue.
QueuedInterceptorsWrapper
A helper class to create queued-interceptors in ease.
RedirectRecord
A record that records the redirection happens during requests, including status code, request method, and the location.
RequestCanceledException
RequestInterceptorHandler
The handler for interceptors to handle before the request has been sent.
RequestOptions
The internal request option class that is the eventual result after BaseOptions and Options are composed.
RequestTimeoutException
Exception that occurs when the request has timed out.
Response<T>
The Response class contains the payload (could be transformed) that respond from the request, and other information of the response.
ResponseBody
The response wrapper class for adapters.
ResponseInterceptorHandler
The handler for interceptors to handle after respond.
SendTimeoutException
Exception that occurs when receiving send time out exception.
ServiceUnavailableException
Exception that occurs when the client receives service unavailable error. Can happen when the response returns status code 503.
SyncTransformer
If you want to custom the transformation of request/response data, you can provide a Transformer by your self, and replace the transformer by setting the Dio.transformer.
Transformer
Transformer allows changes to the request/response data before it is sent/received to/from the server.
UnableToProcessException
Exception that occurs when the client couldn't process the response successfully. Can happen when the response returns status code 422. Or the the model from json function has error on it.
UnauthorizedRequestException
Exception that occurs when receiving an unauthorized request from api mainly when receiving 401,403 error codes.
UnexpectedErrorException
Default client exception.

Enums

DioExceptionType
The exception enumeration indicates what type of exception has happened during requests.
ListFormat
Specifies the array format (a single parameter with multiple parameter or multiple parameters with the same name). and the separator for array items.
ResponseType
Indicates which transformation should be applied to the response data.

Mixins

OptionsMixin
The mixin class for options that provides common attributes.

Typedefs

CreateHttpClient = HttpClient Function()
The signature of IOHttpClientAdapter.createHttpClient. Can be used to provide a custom HttpClient for Dio.
DefaultHttpClientAdapter = IOHttpClientAdapter
DefaultTransformer = SyncTransformer
DioError = DioException
DioError describes the exception info when a request failed.
DioErrorType = DioExceptionType
Deprecated in favor of DioExceptionType and will be removed in future major versions.
ErrorMapper = String? Function(dynamic json)
Function that converts json error response from api to error message.
HeaderForEachCallback = void Function(String name, List<String> values)
The signature that iterates header fields.
InterceptorErrorCallback = void Function(DioException error, ErrorInterceptorHandler handler)
The signature of Interceptor.onError.
InterceptorSendCallback = void Function(RequestOptions options, RequestInterceptorHandler handler)
The signature of Interceptor.onRequest.
InterceptorSuccessCallback = void Function(Response response, ResponseInterceptorHandler handler)
The signature of Interceptor.onResponse.
JsonDecodeCallback = FutureOr Function(String)
The callback definition for decoding a JSON string.
JsonEncodeCallback = FutureOr<String> Function(Object)
The callback definition for encoding a JSON object.
JsonMapper<T> = T Function(dynamic json)
Function that converts json response to the required model.
OnHttpClientCreate = HttpClient? Function(HttpClient client)
The signature of IOHttpClientAdapter.onHttpClientCreate.
ProgressCallback = void Function(int count, int total)
The type of a progress listening callback when sending or receiving data.
RequestEncoder = FutureOr<List<int>> Function(String request, RequestOptions options)
The type of a request encoding callback.
ResponseDecoder = FutureOr<String?> Function(List<int> responseBytes, RequestOptions options, ResponseBody responseBody)
The type of a response decoding callback.
UnauthorizedRequestHandler = void Function(Response? response)
ValidateCertificate = bool Function(X509Certificate? certificate, String host, int port)
The signature of IOHttpClientAdapter.validateCertificate.
ValidateStatus = bool Function(int? status)
The type of a response status code validate callback.

Exceptions / Errors

DioException
DioException describes the exception info when a request failed.
NotNullableError<T>
A TypeError thrown by _checkNotNullable.