copyWith method
PreloadConfig
copyWith({
- int? maxConcurrentTasks,
- Duration? defaultTimeout,
- int? maxRetries,
- Duration? retryBaseDelay,
- bool? enableLogging,
- void onError(
- Object error,
- StackTrace? stackTrace
- Duration? defaultCheckRetryDelay,
- int? defaultMaxCheckRetries,
- Future<
bool> globalCheck()?, - Duration? globalCheckRetryDelay,
- int? globalCheckMaxRetries,
创建副本并修改部分配置
Implementation
PreloadConfig copyWith({
int? maxConcurrentTasks,
Duration? defaultTimeout,
int? maxRetries,
Duration? retryBaseDelay,
bool? enableLogging,
void Function(Object error, StackTrace? stackTrace)? onError,
Duration? defaultCheckRetryDelay,
int? defaultMaxCheckRetries,
Future<bool> Function()? globalCheck,
Duration? globalCheckRetryDelay,
int? globalCheckMaxRetries,
}) {
return PreloadConfig(
maxConcurrentTasks: maxConcurrentTasks ?? this.maxConcurrentTasks,
defaultTimeout: defaultTimeout ?? this.defaultTimeout,
maxRetries: maxRetries ?? this.maxRetries,
retryBaseDelay: retryBaseDelay ?? this.retryBaseDelay,
enableLogging: enableLogging ?? this.enableLogging,
onError: onError ?? this.onError,
defaultCheckRetryDelay: defaultCheckRetryDelay ?? this.defaultCheckRetryDelay,
defaultMaxCheckRetries: defaultMaxCheckRetries ?? this.defaultMaxCheckRetries,
globalCheck: globalCheck ?? this.globalCheck,
globalCheckRetryDelay: globalCheckRetryDelay ?? this.globalCheckRetryDelay,
globalCheckMaxRetries: globalCheckMaxRetries ?? this.globalCheckMaxRetries,
);
}