dependency_injector library

Classes

Injector
Used as a wrapper for the widget you want to inject dependencies into.
ParameterizedScoped<T, P>
Used to create scoped services with parameters.
ParameterizedSingleton<T, P>
Used to create singleton services with parameters.
ParameterizedTransient<T, P>
Used to create transient services with parameters.
RootInjector
Used to configure services. Place it in the root of your application.
Scoped<T>
Used to create scoped services.
Service
Base class for all services.
ServiceKeyBase
Base class for keys.
Singleton<T>
Used to create singleton services.
Transient<T>
Used to create transient services.

Properties

inject Inject
Property used for dependency injection.
read-only

Enums

ServiceIndex
Service indexes.

Typedefs

Builder<T> = T Function()
Typedef for builder function.
Disposer<T> = Future<void> Function(T)
Typedef for disposer function.
Inject = T Function<T, P extends Object>({ServiceIndex index, ServiceKeyBase key, P parameters})
Typedef for inject property.
ParameterizedBuilder<T, P> = T Function(P parameters)
Typedef for parameterizedBuilder function.

Exceptions / Errors

InjectorError
Injector error.