DioUtil class

Constructors

DioUtil()
工厂构造方法
factory

Properties

dio → Dio?
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

initNet({String? baseUrl, Dio? dio, dynamic hookRequest(RequestOptions options)?}) Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
request<T>(String path, {DioMethod method = DioMethod.get, Map<String, dynamic>? parmas, dynamic data, CancelToken? cancelToken, Options? options, Dio? dio, Map<String, dynamic>? extra = const {'needCache' : false}, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<DioResult<T>>
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

CACHE_ENABLE bool
请求的URL前缀 通过外部调用initNet() 初始化请求框架 online 是否开启网络缓存,默认false
getter/setter pair
MAX_CACHE_AGE int
最大缓存时间(按秒), 默认缓存七天,可自行调节
getter/setter pair
MAX_CACHE_COUNT int
最大缓存条数(默认一百条)
getter/setter pair

Constants

CONNECT_TIMEOUT → const int
连接超时时间
RECEIVE_TIMEOUT → const int
响应超时时间