createChild method

ZenScope createChild({
  1. String? name,
})

Create a child scope from this scope

Implementation

ZenScope createChild({String? name}) {
  final childName = name ?? 'Child-${DateTime.now().microsecondsSinceEpoch}';

  // Create child scope with proper parent relationship
  final child = ZenScope(name: childName, parent: this);

  // 🔥 ADD THIS LINE: Register the child with ZenScopeManager so it's tracked
  ZenScopeManager.registerChildScope(child);

  // Add to this scope's children list
  //_childScopes.add(child);

  return child;
}