runWithScope<R> method

R runWithScope<R>(
  1. Set<String> keys,
  2. R body()
)

Runs body while capturing all dependency keys registered during its execution. Used by GetDependencyScope to bind lifecycles to the tree.

Implementation

R runWithScope<R>(Set<String> keys, R Function() body) {
  final previousKeys = _currentScopeKeys;
  _currentScopeKeys = keys;
  try {
    return body();
  } finally {
    _currentScopeKeys = previousKeys;
  }
}