StormyNetworkConfig class
Network Config - 网络配置 用于配置网络请求的相关参数
Constructors
-
StormyNetworkConfig({required String baseUrl, Duration? connectTimeout, Duration? receiveTimeout, Duration? sendTimeout, Map<
String, String> ? headers, List<Interceptor> ? interceptors, bool enableLogging = false}) -
const
-
StormyNetworkConfig.defaultConfig({required String baseUrl, Duration? connectTimeout, Duration? receiveTimeout, Map<
String, String> ? headers}) -
创建默认配置
factory
Properties
- baseUrl → String
-
基础URL
final
- connectTimeout → Duration?
-
连接超时时间
final
- enableLogging → bool
-
是否启用日志
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
→ Map<
String, String> ? -
默认请求头
final
-
interceptors
→ List<
Interceptor> ? -
拦截器列表
final
- receiveTimeout → Duration?
-
接收超时时间
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sendTimeout → Duration?
-
发送超时时间
final
Methods
-
copyWith(
{String? baseUrl, Duration? connectTimeout, Duration? receiveTimeout, Duration? sendTimeout, Map< String, String> ? headers, List<Interceptor> ? interceptors, bool? enableLogging}) → StormyNetworkConfig - 复制并修改配置
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited