addToCache<T> method

void addToCache<T>(
  1. String key,
  2. T value, {
  3. List<String>? tags,
})

Add value to cache with optional tags

Implementation

void addToCache<T>(String key, T value, {List<String>? tags}) {
  _cacheInstance[key] = CacheEntry<T>(
    value: value,
    lastWriteTime: DateTime.now(),
  );

  // Store tags for this key if provided
  if (tags != null && tags.isNotEmpty) {
    _keyTags[key] = tags.toSet();
  }
}