copyWith method

CacheOptions copyWith({
  1. CachePolicy? policy,
  2. Nullable<List<int>>? hitCacheOnErrorExcept,
  3. CacheKeyBuilder? keyBuilder,
  4. Nullable<Duration>? maxStale,
  5. CachePriority? priority,
  6. CacheStore? store,
  7. Nullable<CacheCipher>? cipher,
  8. bool? allowPostMethod,
})

Implementation

CacheOptions copyWith({
  CachePolicy? policy,
  Nullable<List<int>>? hitCacheOnErrorExcept,
  CacheKeyBuilder? keyBuilder,
  Nullable<Duration>? maxStale,
  CachePriority? priority,
  CacheStore? store,
  Nullable<CacheCipher>? cipher,
  bool? allowPostMethod,
}) {
  return CacheOptions(
    policy: policy ?? this.policy,
    hitCacheOnErrorExcept: hitCacheOnErrorExcept != null
        ? hitCacheOnErrorExcept.value
        : this.hitCacheOnErrorExcept,
    keyBuilder: keyBuilder ?? this.keyBuilder,
    maxStale: maxStale != null ? maxStale.value : this.maxStale,
    priority: priority ?? this.priority,
    store: store ?? this.store,
    cipher: cipher != null ? cipher.value : this.cipher,
    allowPostMethod: allowPostMethod ?? this.allowPostMethod,
  );
}