DioManager class
dio配置类
Properties
- baseUrl ↔ String
-
默认baseUrl
getter/setter pair
- connectTimeout ↔ int?
-
连接超时
getter/setter pair
- dio → Dio?
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
header
→ Map<
String, dynamic> -
no setter
- headerDelegate ↔ HeaderDelegate?
-
默认请求header回调
getter/setter pair
- receiveTimeout ↔ int?
-
响应超时
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
) → dynamic -
createErrorEntity(
DioError? error) → ErrorRes -
delHeader(
String key) → dynamic -
imageToBytes(
String imageUrl) → Future< Uint8List> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
request<
T> (Method method, String path, {String? baseUrl, Map< String, dynamic> ? params, Map<String, dynamic> ? header, dynamic data, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, Success? success, CancelToken? cancelToken, OnValueCallBack<CancelToken> ? cancelTokenCallBack, Empty? empty, Error? error}) → Future<void> - 请求,返回参数为 T method:请求方法,NWMethod.GET等 path:请求地址 params:请求参数 success:请求成功回调 error:请求失败回调
-
requestList(
Method method, String path, {String? baseUrl, Map< String, dynamic> ? params, Map<String, dynamic> ? header, dynamic data, SuccessList? success, CancelToken? cancelToken, OnValueCallBack<CancelToken> ? cancelTokenCallBack, Empty? empty, Error? error}) → Future<void> - 请求,返回参数为 List method:请求方法,NWMethod.POST等 path:请求地址 params:请求参数 data:post请求data success:请求成功回调 error:请求失败回调
-
toString(
) → String -
A string representation of this object.
inherited
-
updateHeader(
) → dynamic - 更新header
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ DioManager
-
getter/setter pair