NetOptions class
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
-
addAllInterceptors(
List< Interceptor> interceptors) → NetOptions -
addHeaders(
Map< String, dynamic> headers) → NetOptions - 设置请求头
-
addInterceptor(
Interceptor interceptor) → NetOptions - 添加拦截器
-
create(
) → void - 配置网络请求并初始化
-
enableLogger(
bool enable) → NetOptions - 开启/关闭日志打印 默认使用 PrettyDioLogger 打印
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setBaseUrl(
String baseUrl) → NetOptions - 设置baseUrl
-
setConnectTimeout(
Duration connectTimeOut) → NetOptions - 设置请求的连接超时时间
-
setHttpClientAdapter(
HttpClientAdapter httpClientAdapter) → NetOptions - 设置httpClientAdapter
-
setReceiveTimeOut(
Duration receiveTimeOut) → NetOptions - 设置接收超时时间
-
setSendTimeOut(
Duration sendTimeOut) → NetOptions - 设置数据发送时间
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → NetOptions
-
单例唯一实例
final