update<T> method

void update<T>(
  1. String key,
  2. T update(
    1. T current
    )?, {
  3. bool listen = true,
})

Implementation

void update<T>(
  String key,
  T Function(T current)? update, {
  bool listen = true,
}) {
  if (!_cache.containsKey(key)) {
    return;
  }
  _cache.update(key, (current) => update?.call(current as T));
  if (listen) {
    _notifyListeners();
  }
}