Environment class
This is the DI container which is responsible for the lifecycle of its managed classes
// and offers the main API to retrieve objects via the get<T>
method.
Constructors
-
Environment({Type? forModule, Environment? parent, List<
String> ? features}) -
Create a new Environment
forModule
the module class that determines the classes which will be mangedparent
optional parent environment, whose objects will be inheritedfeatures
list of feature that this environment defines. See Conditional
Properties
-
features
→ List<
String> -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- instances → List
-
final
-
lifecycleProcessors
→ List<
List< LifecycleProcessor> > -
final
- module ↔ Type?
-
getter/setter pair
- parent ↔ Environment?
-
getter/setter pair
-
providers
→ Map<
Type, AbstractInstanceProvider> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
created<
T> (InstanceProvider provider, T instance) → T -
destroy(
) → void - destroy the environment invoking all OnDestroy callbacks.
-
executeProcessors<
T> (InstanceProvider? provider, Lifecycle lifecycle, T instance) → T -
get<
T> ({Type? type}) → T -
return an object given the desired type
T
the generic typetype
optional type for calls where a generic type is not available -
hasFeature(
String feature) → bool -
hasProvider(
Type type) → bool -
initialize(
) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
report(
) → void - print a report on the console showing the providers and their dependencies
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited