pushScope static method

void pushScope(
  1. String scopeName, {
  2. bool useParentScope = false,
})

Called when a new scope is created and becomes active

Implementation

static void pushScope(String scopeName, {bool useParentScope = false}) {
  // Remove if already exists (in case of rebuilds)
  _scopeStack.remove(scopeName);

  // Add to top of stack
  _scopeStack.add(scopeName);
  _scopeCreationTimes[scopeName] = DateTime.now();
  _scopeUsesParentScope[scopeName] = useParentScope;

  if (ZenConfig.enableDebugLogs) {
    ZenLogger.logDebug(
        '📚 Scope stack push: ${_formatStack()} (useParentScope: $useParentScope)');
  }
}