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 same Type<S
> thetag
does not conflict with the same tags used by otherdependencies
Types.permanent
keeps the Instance in memory and persist it, not followingGet.smartManagement
rules. Although, can be removed by GetInstance.reset() and Get.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);