complete_dependency_injector library

A lightweight, fast, and elegant dependency injection library for Dart.

Create an Injector with Providers, register InjectableFactorys, and resolve services with Injector.getService.

Classes

Dependencies
A container for resolved dependencies. When This class provides methods to retrieve specific dependencies by type or token.
Dependency
DependencyData
DependencyDataBuilder
Injectable
InjectableFactory
A factory responsible for creating instances of an injectable type.
InjectableWithDisposeInterface
InjectableWithReadyInterface
Injector
The main entry point for dependency injection.
InjectorDebugOptions
InjectorToken
Provider
Defines how a dependency is provided within an Injector.

Enums

DependencyMapType
InjectableScope

Mixins

InjectableWithReadyMixin

Typedefs

InjectableInstanceCreatorWithDependencies<T extends Object> = T Function(Dependencies dependencies)
A function type that creates an instance of T using resolved dependencies.
InjectableInstanceCreatorWithoutDependencies<T extends Object> = T Function()
A function type that creates an instance of T without any dependencies.
ObjectToDependencyMapItemWrapperConverter = Dependency Function(Object obj)
ObjectToNamedDependencyMapItemWrapperConverter = Dependency Function(Object obj, String name)

Exceptions / Errors

InjectorError