put<S> method
S
put<S>(
- S dependency, {
- String? tag,
- bool permanent = false,
- InstanceBuilderCallback<
S> ? builder,
Injects an Instance<S>
in memory.
No need to define the generic type <[S]>
as it's inferred
from the dependency
parameter.
dependency
The Instance to be injected.tag
optionally, use atag
as an "id" to create multiple records of the sameType<S>
thetag
does not conflict with the same tags used by other dependencies Types.permanent
keeps the Instance in memory and persist it, not followingGet.smartManagement
rules. Although, can be removed byGetInstance.reset()
andGet.delete()
builder
If defined, thedependency
must be returned from here
Implementation
S put<S>(S dependency,
{String? tag,
bool permanent = false,
InstanceBuilderCallback<S>? builder}) =>
GetInstance().put<S>(dependency, tag: tag, permanent: permanent);