Ioc class

A container for IoC instances.

Allows to register and instantiate types to used by other components.

Supports registering types that construct a new object every time they are retrieved from the container (a factory) or constructing/retrieving singleton objects.

Constructors

Ioc()
Creates or returns the instance of the default IoC container.
factory
Ioc.create()
Creates a new IoC container.

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>() → T
Gets a instance of type T that is registered in the container.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
register<T>(T construct()) → void
Registers a new construct function for type T that will produce an object every time it is called.
registerSingle<T>(T construct(), {bool lazy = true}) → void
Registers a new construct function for type T that will be called once to create the object of the specified type.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited