copyWith method

RxNetConfig copyWith({
  1. String? baseUrl,
  2. NetworkAdapter? adapter,
  3. AdapterBaseOptions? adapterBaseOptions,
  4. String? cachePath,
  5. String? cacheName,
  6. String? databaseName,
  7. CacheMode? cacheMode,
  8. List<AdapterInterceptor>? interceptors,
  9. bool? systemLog,
  10. bool? isDebug,
  11. CheckNetWork? baseCheckNet,
  12. List<String>? ignoreCacheKeys,
  13. Map<String, dynamic>? baseUrlEnv,
  14. int? cacheInvalidationTime,
  15. int? cacheMaxSize,
  16. CacheEvictionPolicy? cacheEvictionPolicy,
  17. double? debugWindowWidth,
  18. double? debugWindowHeight,
  19. bool clearAdapter = false,
  20. bool clearAdapterBaseOptions = false,
  21. bool clearCachePath = false,
  22. bool clearInterceptors = false,
  23. bool clearBaseCheckNet = false,
  24. bool clearIgnoreCacheKeys = false,
  25. 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,
  );
}