NetOptions class
Properties
- dio → Dio
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- httpDecoder → NetDecoder
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addAllInterceptors(
List< Interceptor> interceptors) → NetOptions - Adding all the interceptors to the dio instance.
-
addHeaders(
Map< String, dynamic> headers) → NetOptions - Adding headers to the request.
-
addInterceptor(
Interceptor interceptor) → NetOptions - Adding an interceptor to the dio instance.
-
create(
) → void - 配置网络请求并初始化
-
enableLogger(
bool enable) → NetOptions - Used to enable/disable the logger. 默认使用 PrettyDioLogger 打印
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setBaseUrl(
String baseUrl) → NetOptions - Setting the base url for the http request.
-
setConnectTimeout(
Duration connectTimeout) → NetOptions - Setting the connection timeout for the http request.
-
setHttpClientAdapter(
HttpClientAdapter httpClientAdapter) → NetOptions - Setting the httpClientAdapter for the http request. ex: proxy Certificate
-
setHttpDecoder(
NetDecoder httpDecoder) → NetOptions - Used to set the decoder for the response.
-
setReceiveTimeout(
Duration receiveTimeout) → NetOptions - Setting the timeout for receiving data.
-
setSendTimeout(
Duration sendTimeout) → NetOptions - Setting the timeout for sending data.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → NetOptions
-
the one and only instance of this singleton
final