getNotifier method

  1. @protected
  2. @visibleForTesting
ResultNotifier<T> getNotifier(
  1. K key, {
  2. bool shouldRefresh = false,
  3. bool force = false,
  4. bool alwaysTouch = false,
})

Implementation

@protected
@visibleForTesting
ResultNotifier<T> getNotifier(K key, {bool shouldRefresh = false, bool force = false, bool alwaysTouch = false}) {
  var notifier = _cache[key]?.notifier;
  if (notifier != null && shouldRefresh) {
    Future.microtask(() => notifier!.isActive ? notifier.refresh(force: force, alwaysTouch: alwaysTouch) : null);
  } else if (notifier == null) {
    notifier = (_cache[key] = _createNotifier(key)).notifier;
    _updateAutoDisposeTimer();
  }
  return notifier;
}