getExpiryForUpdate method Null safety

  1. @override
Duration getExpiryForUpdate()
override

Gets the Duration before an updated CacheEntry is considered expired.

This method is called by the caching implementation after a CacheEntry is updated to determine the Duration before the updated entry expires. If a Duration.zero is returned a CacheEntry is considered immediately expired. Returning null will result in no change to the previously understood expiry Duration.

Returns the new Duration before an updated entry expires

Implementation

@override
Duration getExpiryForUpdate() {
  // When a cache entry is modified, we return the specified expiry duration,
  // ignoring the current expiry duration
  return _expiryDuration;
}