Container class
Container is used to register mappings between each abstraction (service) and its corresponding implementation (component).
- Implementers
Constructors
- Container([ContainerOptions options = const ContainerOptions()])
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- options → ContainerOptions
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addInstanceProducer(
Type serviceType, InstanceProducer instanceProducer) → void -
contains<
TService> () → bool -
dispose(
) → void -
get<
TService> () → TService -
Gets an instance of the given
TService
. Throws ActivationException when there are errors resolving the service instance. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
register<
TService, TImplementation extends TService> (Constructor< TImplementation> constructor, [Lifestyle lifestyle = Lifestyle.transient]) → void -
Registers a constructor for type
TService
. This constructor must be specified inconstructor
and must generate an instance ofTImplementation
which, in turn, must inherit fromTService
. Default value oflifestyle
is Lifestyle.transient. -
registerSimple<
TService> (Constructor< TService> constructor, [Lifestyle lifestyle = Lifestyle.transient]) → void -
Registers a constructor for type
TService
. This constructor must be specified inconstructor
and must generate an instance ofTService
. Default value oflifestyle
is Lifestyle.transient. -
toString(
) → String -
A string representation of this object.
inherited
-
unregister<
TService> () → void -
Unregisters the producer to
TService
, if it already registered.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited