Skip to main content
The Archery IoC container owns application services and their lifetimes; you will register dependencies, resolve them, isolate scopes, and clean them up.

Register services

Use bind for a new value on every resolution, singleton for one value per scope, and bindInstance for an object you already created. Factory callbacks receive the container and optional runtime options.
lib/src/providers/aws/s3_client_provider.dart
example/main.dart

Resolve and inspect

lib/src/http/routes/web.dart
make<T>() throws ServiceContainerException.registrationNotFound when no binding exists. Use tryMake<T>() when absence is expected. Pass name to registration and resolution methods when you need several implementations of one type.

Manage lifecycle

Call initialize() to construct eager singletons and allReady() to await tracked asynchronous initialization. Register cleanup with onDispose() and call dispose() to run callbacks in reverse order.
lib/src/bootstrap.dart
newScope() inherits parent bindings but keeps its own singleton instances, which makes it suitable for request or feature isolation.