init static method
dynamic
init({
- required String httpBaseUrl,
- HeaderDelegate? headerDelegate,
- int? connectTimeout,
- int? receiveTimeout,
httpBaseUrl
网络请求域名设置
headerDelegate
全局header请求设置
connectTimeout
请求超时时间 毫秒
receiveTimeout
响应超时时间 毫秒
Implementation
static init({
required String httpBaseUrl,
HeaderDelegate? headerDelegate,
int? connectTimeout,
int? receiveTimeout,
}) {
DioManager.instance.baseUrl = httpBaseUrl;
DioManager.instance.headerDelegate = headerDelegate;
DioManager.instance.connectTimeout = connectTimeout;
DioManager.instance.receiveTimeout = receiveTimeout;
}