DependencyManager class

Service locator for state machine dependencies.

Implemented types
Implementers

Constructors

DependencyManager([Map<Token<Object>, DependencyBuilder<Object>>? builders])
Service locator for state machine dependencies.
DependencyManager.scoped(DependencyManager parent)
A service locator scoped to a parent DependencyManager.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addBuilder<T extends Object>(DependencyBuilder<T> builder, [Token<T>? token]) → void
Adds a builder to the service locator.
addInstance<T extends Object>(T instance, [Token<T>? token]) → void
Adds an instance to the service locator.
close() → void
Closes the resource and all connected objects.
override
create<T extends Object>([Token<T>? token]) → T
Creates an instance of type T using its registered builder.
expect<T extends Object>([Token<T>? token]) → T
Asserts an instance for type T.
get<T extends Object>([Token<T>? token]) → T?
Gets the instance for type T, if available.
getOrCreate<T extends Object>([Token<T>? token]) → T
Gets the instance for type T or creates it using a registered builder.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited