copyWith method

ScrapingStrategy copyWith({
  1. int? retries,
  2. int? timeout,
  3. Map<String, String>? headers,
  4. int? initialBackoff,
  5. double? backoffMultiplier,
  6. int? maxBackoff,
  7. bool? useRandomUserAgent,
  8. bool? rotateProxiesOnRetry,
  9. bool? validateProxies,
})

Creates a copy of this strategy with the given parameters

Implementation

ScrapingStrategy copyWith({
  int? retries,
  int? timeout,
  Map<String, String>? headers,
  int? initialBackoff,
  double? backoffMultiplier,
  int? maxBackoff,
  bool? useRandomUserAgent,
  bool? rotateProxiesOnRetry,
  bool? validateProxies,
}) {
  return ScrapingStrategy(
    retries: retries ?? this.retries,
    timeout: timeout ?? this.timeout,
    headers: headers ?? Map.from(this.headers),
    initialBackoff: initialBackoff ?? this.initialBackoff,
    backoffMultiplier: backoffMultiplier ?? this.backoffMultiplier,
    maxBackoff: maxBackoff ?? this.maxBackoff,
    useRandomUserAgent: useRandomUserAgent ?? this.useRandomUserAgent,
    rotateProxiesOnRetry: rotateProxiesOnRetry ?? this.rotateProxiesOnRetry,
    validateProxies: validateProxies ?? this.validateProxies,
  );
}