getExpiryForCreation method Null safety

  1. @override
Duration getExpiryForCreation()

Gets the Duration before a newly created CacheEntry is considered expired.

This method is called by a caching implementation after a CacheEntry is created, but before a CacheEntry is added to a cache, to determine the Duration before an entry expires. If a is returned the new CacheEntry is considered to be already expired and will not be added to the Cache.

Returns the new Duration before a created entry expires


Duration getExpiryForCreation() {
  // The initial expiry duration is the same as if the entry was accessed
  return _expiryDuration;