copyWith method

PreloadConfig copyWith({
  1. int? maxConcurrentTasks,
  2. Duration? defaultTimeout,
  3. int? maxRetries,
  4. Duration? retryBaseDelay,
  5. bool? enableLogging,
  6. void onError(
    1. Object error,
    2. StackTrace? stackTrace
    )?,
  7. Duration? defaultCheckRetryDelay,
  8. int? defaultMaxCheckRetries,
  9. Future<bool> globalCheck()?,
  10. Duration? globalCheckRetryDelay,
  11. 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,
  );
}