initialize method

void initialize({
  1. String cacheKey = _key,
  2. Duration stalePeriod = _stalePeriod,
  3. int maxNrOfCacheObjects = _maxNrOfCacheObjects,
})

Initialize the CacheManager with custom configuration cacheKey - Unique key for the cache stalePeriod - Duration before a cache object is considered stale maxNrOfCacheObjects - Maximum number of objects to keep in cache

Implementation

void initialize({
  String cacheKey = _key,
  Duration stalePeriod = _stalePeriod,
  int maxNrOfCacheObjects = _maxNrOfCacheObjects,
}) {
  // Store config for lazy initialization
  _configCacheKey = cacheKey;
  _configStalePeriod = stalePeriod;
  _configMaxCacheObjects = maxNrOfCacheObjects;

  // Only actually initialize if explicitly called
  _performInitialization();
}