createScope static method

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

Create a new scope for isolated dependencies

If parent is not provided, it defaults to rootScope.

Note: For widget-based scopes, use ZenRoute or ZenScopeWidget instead. This method is for programmatic scope creation outside the widget tree.

Implementation

static ZenScope createScope({String? name, ZenScope? parent}) {
  final scopeName = name ?? 'Scope_${DateTime.now().millisecondsSinceEpoch}';
  return ZenScope(
    name: scopeName,
    parent: parent ?? rootScope,
  );
}