copyWith method
CachePolicy
copyWith({
- Duration? staleTime,
- Duration? expiry,
- Duration? slidingExpiry,
- CachePriority? priority,
- RefreshStrategy? refreshStrategy,
- int? maxSize,
- 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,
);
}