IocContainer class

A built Ioc Container. To create a new IocContainer, use IocContainerBuilder. To get a service from the container, call get. Builders create immutable containers unless you specify the isLazy option on toContainer(). You can build your own container by injecting service definitions and singletons here

Available Extensions
Annotations
  • @immutable

Constructors

IocContainer(Map<Type, ServiceDefinition> serviceDefinitionsByType, Map<Type, Object> singletons)
Creates an IocContainer. Y
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serviceDefinitionsByType Map<Type, ServiceDefinition>
This is only here for testing and you should not use this in your code
final
singletons Map<Type, Object>
This is only here for testing and you should not use this in your code
final

Methods

get<T>() → T
Get an instance of the service by type
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