copyWith method
RxNetConfig
copyWith({
- String? baseUrl,
- NetworkAdapter? adapter,
- AdapterBaseOptions? adapterBaseOptions,
- String? cachePath,
- String? cacheName,
- String? databaseName,
- CacheMode? cacheMode,
- List<
AdapterInterceptor> ? interceptors, - bool? systemLog,
- bool? isDebug,
- CheckNetWork? baseCheckNet,
- List<
String> ? ignoreCacheKeys, - Map<
String, dynamic> ? baseUrlEnv, - int? cacheInvalidationTime,
- int? cacheMaxSize,
- CacheEvictionPolicy? cacheEvictionPolicy,
- double? debugWindowWidth,
- double? debugWindowHeight,
- bool clearAdapter = false,
- bool clearAdapterBaseOptions = false,
- bool clearCachePath = false,
- bool clearInterceptors = false,
- bool clearBaseCheckNet = false,
- bool clearIgnoreCacheKeys = false,
- bool clearBaseUrlEnv = false,
复制并修改配置
Implementation
RxNetConfig copyWith({
String? baseUrl,
NetworkAdapter? adapter,
AdapterBaseOptions? adapterBaseOptions,
String? cachePath,
String? cacheName,
String? databaseName,
CacheMode? cacheMode,
List<AdapterInterceptor>? interceptors,
bool? systemLog,
bool? isDebug,
CheckNetWork? baseCheckNet,
List<String>? ignoreCacheKeys,
Map<String, dynamic>? baseUrlEnv,
int? cacheInvalidationTime,
int? cacheMaxSize,
CacheEvictionPolicy? cacheEvictionPolicy,
double? debugWindowWidth,
double? debugWindowHeight,
bool clearAdapter = false,
bool clearAdapterBaseOptions = false,
bool clearCachePath = false,
bool clearInterceptors = false,
bool clearBaseCheckNet = false,
bool clearIgnoreCacheKeys = false,
bool clearBaseUrlEnv = false,
}) {
return RxNetConfig(
baseUrl: baseUrl ?? this.baseUrl,
adapter: clearAdapter ? null : (adapter ?? this.adapter),
adapterBaseOptions: clearAdapterBaseOptions
? null
: (adapterBaseOptions ?? this.adapterBaseOptions),
cachePath: clearCachePath ? null : (cachePath ?? this.cachePath),
cacheName: cacheName ?? this.cacheName,
databaseName: databaseName ?? this.databaseName,
cacheMode: cacheMode ?? this.cacheMode,
interceptors:
clearInterceptors ? null : (interceptors ?? this.interceptors),
systemLog: systemLog ?? this.systemLog,
isDebug: isDebug ?? this.isDebug,
baseCheckNet: clearBaseCheckNet
? null
: (baseCheckNet ?? this.baseCheckNet),
ignoreCacheKeys: clearIgnoreCacheKeys
? null
: (ignoreCacheKeys ?? this.ignoreCacheKeys),
baseUrlEnv:
clearBaseUrlEnv ? null : (baseUrlEnv ?? this.baseUrlEnv),
cacheInvalidationTime:
cacheInvalidationTime ?? this.cacheInvalidationTime,
cacheMaxSize: cacheMaxSize ?? this.cacheMaxSize,
cacheEvictionPolicy:
cacheEvictionPolicy ?? this.cacheEvictionPolicy,
debugWindowWidth: debugWindowWidth ?? this.debugWindowWidth,
debugWindowHeight: debugWindowHeight ?? this.debugWindowHeight,
);
}