currentScope property

LevitScope get currentScope

Returns the currently active LevitScope.

If run within a LevitScopeImplicitScopeExtension.run zone, returns that scope. Otherwise, returns the global root scope.

Implementation

static LevitScope get currentScope {
  final implicit = Zone.current[Ls.zoneScopeKey];
  if (implicit is LevitScope) return implicit;
  return _root;
}