Tutorials
Build a pure-Dart object graph
Configure async clients, repositories, services, child overrides, and dependency-ordered teardown.
v0.1.0-dev.1Intermediateark_di
Build a pure-Dart object graph
Define the Composition Root
Bind immutable configuration as an Instance. Bind an async client, Repository, and service as Lazy Singletons with explicit disposers.
Resolve the application service
Use getAsync<CatalogService>(). Ark DI initializes the client first, then the Repository and service, while recording the dependency graph.
Create a bounded preview Scope
Create a child and override the Repository with an in-memory implementation. Override its consuming service so the child graph captures the local Repository.
Close child before parent
Close the preview Scope, then the application container. Verify that services close before repositories and repositories before clients.