rxnet_lib
library
Classes
AdapterInterceptor
统一的拦截器接口
AdapterRequest
author: ZhengZaiHong
email:1096877329@qq.com
date: 2026-04-21 16:03
describe: request adapter
Unified request configuration model.
AdapterResponse <T >
author: ZhengZaiHong
email:1096877329@qq.com
date: 2026-04-21 16:04
describe: 统一的响应包装模型
屏蔽不同网络库的响应差异,提供统一的响应接口
BackgroundTransformer
The default Transformer for Dio .
BaseOptions
A set of base settings for each Dio().
BaseOptions and Options will be merged into one RequestOptions before
sending the requests. See Options.compose .
BuildRequest <T >
author: ZhengZaiHong
email: 1096877329@qq.com
date: 2025-08-12
describe: BuildRequest - 网络请求构建器 / Network Request Builder
CancelToken
author: ZhengZaiHong
email:1096877329@qq.com
date: 2026-04-23 11:17
Token for cancelling network requests.
ContentTypes
author: ZhengZaiHong
email:1096877329@qq.com
date: 2025/8/24
time: 18:29
describe: Content-Type 类型
Dio
Dio enables you to make HTTP requests easily.
DioAdapter
DioAdapter - Dio-based implementation of NetworkAdapter
DioForNative
Implements features for Dio on native platforms.
DioMixin
Downloader
author: ZhengZaiHong
email:1096877329@qq.com
date: 2023/9/26
time: 12:17
describe: 只提供给 web端
ErrorInterceptorHandler
错误拦截器处理器
FormData
A class to create readable "multipart/form-data" streams.
It can be used to submit forms and file uploads to http server.
FusedTransformer
A Transformer that has a fast path for decoding UTF8-encoded JSON.
If the response is utf8-encoded JSON and no custom decoder is specified in the RequestOptions , this transformer
is significantly faster than the default SyncTransformer and the BackgroundTransformer .
This improvement is achieved by using a fused Utf8Decoder and JsonDecoder to decode the response,
which is faster than decoding the utf8-encoded JSON in two separate steps, since
Dart uses a special fast decoder for this case.
See https://github.com/dart-lang/sdk/blob/5b2ea0c7a227d91c691d2ff8cbbeb5f7f86afdb9/sdk/lib/_internal/vm/lib/convert_patch.dart#L40
The headers class for requests and responses.
HttpAdapter
author: ZhengZaiHong
email: 1096877329@qq.com
date: 2026-04-23
describe:HttpAdapter - 基于 http 包的轻量级网络适配器 / Lightweight Network Adapter Based on http Package
HttpClientAdapter
HttpAdapter is a bridge between Dio and HttpClient .
HttpError
author: ZhengZaiHong
email:1096877329@qq.com
date: 2021/6/9
time: 15:17
describe: HTTP 状态码
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 Interceptor s.
InterceptorsWrapper
A helper class to create interceptors in ease.
IOClient
A dart:io-based HTTP Client.
IOHttpClientAdapter
The default HttpClientAdapter for native platforms.
IOStreamedResponse
An HTTP response where the response body is received asynchronously after
the headers have been received.
ListParam <T >
Indicates a param being used as queries or form data,
and how does it gets formatted.
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.
LogUtil
author: ZhengZaiHong
email:1096877329@qq.com
date: 2021/6/9
time: 15:48
describe: 日志输出
MD5Util
MockAdapter
Mock 适配器实现
MultipartFile
An upload content that is a part of MultipartRequest.
This doesn't need to correspond to a physical file.
NetworkAdapter
Abstract interface for network adapters in RxNet Plus.
Options
The configuration for a single request.
BaseOptions and Options will be merged into one RequestOptions before
sending the requests. See Options.compose .
QueuedInterceptor
Interceptor in queue.
QueuedInterceptorsWrapper
A helper class to create QueuedInterceptor in ease.
RedirectRecord
A record that records the redirection happens during requests,
including status code, request method, and the location.
RequestInterceptorHandler
author: ZhengZaiHong
email:1096877329@qq.com
date: 2026-04-21 16:04
describe: 请求拦截器处理器
用于在拦截器中控制请求流程
RequestOptions
The internal request option class that is the eventual result after
BaseOptions and Options are composed.
RequestState <T >
author:ZhengZaiHong
email:1096877329@qq.com
date:2026-06-02 11:27
describe: 跟踪请求执行的内部状态
Internal state for tracking request execution
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
响应拦截器处理器
RxNet
RxNet Plus - Flutter 网络请求库 / Flutter Network Request Library
RxNetLogAdapterInterceptor
适配器版本的日志拦截器
RxNetPlatform
author: ZhengZaiHong
email:1096877329@qq.com
date: 2025-08-12
time: 16:02
describe: 平台判断
RxNetPlus
author: ZhengZaiHong
email:1096877329@qq.com
date: 2025-08-12
time: 11:20
describe: 必须在根路径下
The OHOS implementation of PathProviderPlatform.
RxnetSimpleLogInterceptor
author: ZhengZaiHong
email:1096877329@qq.com
date: 2026-04-23 9:06
describe: 简易输出所有请求和响应信息
RxResult <T >
author: ZhengZaiHong
email:1096877329@qq.com
date: 2023/9/14
time: 16:21
describe: 响应结果包装类
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 .
TextUtil
author: ZhengZaiHong
email:1096877329@qq.com
date: 2025-08-12
time: 16:02
describe: 字符串工具
Transformer
Transformer allows changes to the request/response data before
it is sent/received to/from the server.
ZipRequest <T >
Wrapper for callback-based request methods with type information.
ZipRequestError
author:郑再红
email:1096877329@qq.com
date:2026-06-02 11:28
describe:带有上下文的请求错误包装器
Wrapper for request errors with context
ZipResults
author:ZhengZaiHong
email:1096877329@qq.com
date:2026-06-02 11:27
describe: 通过zipRequest 执行的并发请求聚合结果的容器。
Container for aggregated results from concurrent requests executed via zipRequest .
ZipResults provides type-safe access to results from multiple concurrent requests,
maintaining the original submission order and supporting both index-based and tag-based access.
Mixins
OptionsMixin
The mixin class for options that provides common attributes.
Functions
createInternalCompleted <T > (ZipRequest <T > zipRequest )
→ Completed
Creates an internal completed callback (currently no-op).
Kept for future extensibility.
createInternalFailure <T > (ZipRequest <T > zipRequest , Completer <T > completer , int index )
→ Failure
Creates an internal failure callback that completes the Completer with error.
Captures stack trace for better error debugging.
createInternalSuccess <T > (ZipRequest <T > zipRequest , Completer <T > completer )
→ Success <T >
创建一个内部成功回调函数来完成Completer。
Creates an internal success callback that completes the Completer.
createRequestState <T > (ZipRequest <T > request , int index )
→ RequestState <T >
Factory function to create a typed RequestState
This helps maintain type safety during request state initialization
defaultDioExceptionReadableStringBuilder (DioException e )
→ String
The default implementation of building a readable string of DioException .
invokeRequest <T > (ZipRequest <T > zipRequest , Success <T > internalSuccess , Failure internalFailure , Completed internalCompleted )
→ void
Invokes a request method with internal callbacks and user parameters merged.
Internal callbacks take precedence over user parameters.
log2Console (Object object )
→ void
author: ZhengZaiHong
email:1096877329@qq.com
date: 2026-04-20
describe: 适配器版本的日志拦截器
实现 AdapterInterceptor 接口,与具体网络库解耦
zipRequest (List <ZipRequest > requests , {bool eagerError = true , CancelToken ? cancelToken , Duration ? timeout })
→ Future <ZipResults >
Main function to execute multiple callback-based requests concurrently.
Typedefs
CacheInvalidationCallback <T >
= void Function()
缓存失效超时回调
CheckNetWork
= Future <bool > Function()
检查网络的方法 是否有网络
Completed <T >
= void Function()
成功或失败都会执行的方法
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.
DioExceptionReadableStringBuilder
= String Function(DioException e )
The readable string builder's signature of
DioException.readableStringBuilder .
DioMediaType
= MediaType
The type (alias) for specifying the content-type of the MultipartFile.
Failure <T >
= void Function(dynamic data )
失败回调
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.
JsonTransformation <E >
= E Function(Map <String , dynamic > data )
json转实体店回调
OnHttpClientCreate
= HttpClient ? Function(HttpClient client )
The signature of IOHttpClientAdapter.onHttpClientCreate .
ParamCallBack
= void Function(Map <String , dynamic > params )
ProgressCallback
= void Function(int count , int total )
author:ZhengZaiHong
email:1096877329@qq.com
date:2026-05-20 13:58
describe: Really requesting an adapter for the network
Progress callback function type for file upload/download operations.
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.
Success <T >
= void Function(T data , SourcesType model )
http请求成功回调
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.
ZipRequestFunction <T >
= void Function({Completed ? completed , Failure ? failure , Success <T > ? success })
author:ZhengZaiHong
email:1096877329@qq.com
date:2026-05-29 9:46
describe: 基于回调的请求方法的类型定义
Type definition for callback-based request methods.
This function type explicitly defines the three callback parameters that
RxNet's async methods accept: success, failure, and completed.