copyWith method

CachePolicy copyWith({
  1. Duration? staleTime,
  2. Duration? expiry,
  3. Duration? slidingExpiry,
  4. CachePriority? priority,
  5. RefreshStrategy? refreshStrategy,
  6. int? maxSize,
  7. bool? encrypt,
})

Creates a copy of this policy with the specified fields replaced with new values.

Implementation

CachePolicy copyWith({
  Duration? staleTime,
  Duration? expiry,
  Duration? slidingExpiry,
  CachePriority? priority,
  RefreshStrategy? refreshStrategy,
  int? maxSize,
  bool? encrypt,
}) {
  return CachePolicy(
    staleTime: staleTime ?? this.staleTime,
    expiry: expiry ?? this.expiry,
    slidingExpiry: slidingExpiry ?? this.slidingExpiry,
    priority: priority ?? this.priority,
    refreshStrategy: refreshStrategy ?? this.refreshStrategy,
    maxSize: maxSize ?? this.maxSize,
    encrypt: encrypt ?? this.encrypt,
  );
}