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'}-${DateTime.now().millisecondsSinceEpoch}' {
  // Add to parent's child scopes
  parent?._childScopes.add(this);

  if (ZenConfig.enableDebugLogs) {
    ZenLogger.logDebug('Created scope: $name (id: $id)');
  }
}