Container class
Properties
Methods
-
createChild(
) → Container - Creates a child Container that can define its own singletons and factories.
-
findByName<
T> (String name) → T - Finds a named singleton.
-
has<
T> ([Type? t]) → bool - Determines if the container has an injection of the given type.
-
hasNamed(
String name) → bool -
Determines if the container has a named singleton with the given
name
. -
make<
T> ([Type? type]) → T -
Instantiates an instance of
T
. -
makeAsync<
T> ([Type? type]) → Future< T> -
Instantiates an instance of
T
, asynchronously. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerFactory<
T> (T f(Container), {Type? as}) → T Function(Container) -
Registers a factory. Any attempt to resolve the
type within this container will return the result of
f
. -
registerLazySingleton<
T> (T f(Container), {Type? as}) → T Function(Container) - Shorthand for registering a factory that injects a singleton when it runs.
-
registerNamedSingleton<
T> (String name, T object) → T - Registers a named singleton.
-
registerSingleton<
T> (T object, {Type? as}) → T -
Registers a singleton. Any attempt to resolve the
type within this container will return
object
. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited