ZenScope constructor

ZenScope({
  1. ZenScope? parent,
  2. String? name,
  3. String? id,
})

Creates a new scope

Implementation

ZenScope({
  this.parent,
  this.name,
  String? id,
}) : id = id ?? '${name ?? 'scope'}-${++_idCounter}' {
  // Add to parent's child scopes
  parent?._childScopes.add(this);

  // Track in live-scope registry for lifecycle & DevTools visibility
  _activeScopes.add(this);

  ZenLogger.logDebug('Created scope: $name (id: ${this.id})');
}