getParentScope static method

String? getParentScope(
  1. String scopeName
)

Get the parent scope name for a given scope Returns the scope that was active immediately before the given scope

Implementation

static String? getParentScope(String scopeName) {
  final index = _scopeStack.indexOf(scopeName);
  if (index > 0) {
    // Return the scope immediately before this one in the stack
    return _scopeStack[index - 1];
  }
  return null; // No parent (root level)
}