IocContainer class
📦 A built Ioc Container. To create a new IocContainer, use
IocContainerBuilder. To get a service from the container, call
get, getAsync
, or getAsyncSafe
Call scoped
to get a scoped container
- Available Extensions
Constructors
-
IocContainer(Map<
Type, ServiceDefinition> serviceDefinitionsByType, Map<Type, Object> singletons, {bool isScoped = false}) -
📦 Creates an IocContainer. You can build your own container by injecting
service definitions and singletons here, but you should probably use
IocContainerBuilder instead.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isScoped → bool
-
⌖ If true, this container is a scoped container. Scoped containers never
create more than one instance of a service
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
serviceDefinitionsByType
→ Map<
Type, ServiceDefinition> -
📙 The service definitions by type
final
-
singletons
→ Map<
Type, Object> -
1️⃣ Map of singletons or scoped services by type. This map is mutable
so the container can store scope or singletons
final
Methods
-
call<
T extends Object> () → T - 👐 This is a shortcut for get
-
get<
T extends Object> () → 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