HttpDioConfig constructor
HttpDioConfig({
- int connectTimeout = 15000,
- int receiveTimeout = 15000,
- dynamic successCode = 200,
- int tokenInvalidCode = 401,
- String errorMessage = "",
- String baseUrl = "",
- bool isNeedProxy = false,
- String? proxyHost,
- Map<
String, dynamic> ? headers, - InterceptorsWrapper? headerInterceptor,
- InterceptorsWrapper? tokenInterceptor,
- InterceptorsWrapper? logInterceptor,
- List<
InterceptorsWrapper> ? interceptors, - LoadingConfig? loadingConfig,
- String? language,
Implementation
HttpDioConfig({
int connectTimeout = 15000,
int receiveTimeout = 15000,
dynamic successCode = 200,
int tokenInvalidCode = 401,
String errorMessage = "",
String baseUrl = "",
bool isNeedProxy = false,
String? proxyHost,
Map<String, dynamic>? headers,
InterceptorsWrapper? headerInterceptor,
InterceptorsWrapper? tokenInterceptor,
InterceptorsWrapper? logInterceptor,
List<InterceptorsWrapper>? interceptors,
LoadingConfig? loadingConfig,
String? language,
}) {
this.connectTimeout =
connectTimeout == 0 ? this.connectTimeout : connectTimeout;
this.receiveTimeout =
receiveTimeout == 0 ? this.receiveTimeout : connectTimeout;
this.successCode = successCode;
this.tokenInvalidCode = tokenInvalidCode;
this.errorMessage = errorMessage;
this.baseUrl = baseUrl;
this.headerInterceptor = headerInterceptor ?? this.headerInterceptor;
this.tokenInterceptor = tokenInterceptor ?? this.tokenInterceptor;
this.logInterceptor = logInterceptor ?? this.logInterceptor;
this.isNeedProxy = isNeedProxy;
// String proxy = proxyHost ?? "";
this.proxyHost = "PROXY $proxyHost";
this.headers = headers ?? this.headers;
this.interceptors = interceptors ?? this.interceptors;
this.loadingConfig = loadingConfig??LoadingConfig();
this.language=language??"zh";
}