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.
dependencyThe Instance to be injected.tagoptionally, use atagas an "id" to create multiple records of the sameType<S>thetagdoes not conflict with the same tags used by other dependencies Types.permanentkeeps the Instance in memory and persist it, not followingGet.smartManagementrules. Although, can be removed byGetInstance.reset()andGet.delete()builderIf defined, thedependencymust 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);