Scope
A Scope manages a tree of modules and dependency instances. Scopes can be nested into hierarchies (parent-child), supporting modular app composition and context-specific overrides.
You typically work with the root scope, but can also create named subscopes as needed.
Example
Section titled “Example”// Open the main/root scopefinal rootScope = CherryPick.openRootScope();
// Install a custom modulerootScope.installModules([AppModule()]);
// Resolve a dependency synchronouslyfinal str = rootScope.resolve<String>();
// Resolve a dependency asynchronouslyfinal result = await rootScope.resolveAsync<String>();
// Recommended: Close the root scope and release all resourcesawait CherryPick.closeRootScope();
// Alternatively, you may manually call dispose on any scope you manage individually// await rootScope.dispose();