ZenScopeManager class

Comprehensive scope manager with lifecycle management and hierarchy navigation Handles both scope creation/disposal and hierarchy traversal operations

Constructors

ZenScopeManager.new()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

rootScope ZenScope
no setter

Static Methods

cleanupAllScopesExcept(String keepScopeName) → void
Clean up all scopes except the specified one and the root scope This is called when a route with useParentScope=false is created or popped back to
cleanupStackTrackedScopesExcept(String keepScopeName) → void
Clean up only scopes that are tracked in the scope stack This preserves manually created scopes that aren't part of navigation
collectScopesRecursively(ZenScope scope, List<ZenScope> collection) → void
Recursively collect all scopes starting from a given scope
debugHierarchy() String
disposeAll() → void
findScopeByName(String name) ZenScope?
Find scope by name in the hierarchy
forceDispose(String scopeName) → void
getAllScopes() List<ZenScope>
Get all scopes in the system recursively This is the core method that must properly traverse child scopes Maintains API compatibility with previous ZenHierarchyManager
getAllTrackedScopes() List<ZenScope>
Get all tracked scopes (persistent + auto-dispose + root) This ensures we capture both tracked scopes and dynamically created child scopes
getChildScopes(String parentScopeName) Set<String>
getOrCreateScope({required String name, ZenScope? parentScope, bool? autoDispose, bool useRootAsDefault = false}) ZenScope
Creates or retrieves a scope with intelligent parent-child linking
getScope(String name) ZenScope?
getScopeDepth(ZenScope targetScope) int
Get hierarchy depth for a specific scope
getScopesAtDepth(int depth) List<ZenScope>
Get all scopes at a specific depth level
getStats() Map<String, int>
isExplicitlyPersistent(String scopeName) bool
isTracking(String scopeName) bool
onWidgetDispose(String scopeName, bool autoDispose) → void
Called when widget disposes - handles complete disposal logic
registerChildScope(ZenScope childScope) → void
Internal method to register child scopes created via createChild()