ContainerMixin mixin
This is a Dependency Injection container implementation.
- Mixin Applications
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
-
get<
T> ([String name = '']) → T -
Returns the service instance for type
T
. Specifyname
to get the named instance. -
getCached<
T extends Object> ([String name = '']) → T? -
Returns the service instance for type
T
if it has already been instantiated. Providename
to get the named instance. -
has<
T> ([String name = '']) → bool - Returns true if the service is registered in the container
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
provide<
T extends Object> (FactoryFun< T> factory, {String name = '', bool cached = true}) → void -
Registers a service
factory
of typeT
in the container. Specifyname
to have several (named) factories of the same type. By default, all services are singletons. Setcached
tofalse
to get a new instance each time the service is requested. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited