createChild method

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

Create a child scope from this scope

Child scopes automatically inherit dependencies from their parent and are automatically disposed when the parent is disposed.

Implementation

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

  // Create child scope with proper parent relationship
  // Parent tracking is automatic via constructor
  final child = ZenScope(name: childName, parent: this);

  return child;
}