lazyPut<S> method
Registers a lazy builder in this scope.
The builder is executed only when the dependency is first requested via find.
Parameters:
Implementation
void lazyPut<S>(S Function() builder,
{String? tag, bool permanent = false, bool isFactory = false}) {
final key = _getKey<S>(tag);
if (!isFactory &&
_registry.containsKey(key) &&
_registry[key]!.isInstantiated) {
return;
}
final info = LevitDependency<S>(
builder: builder,
permanent: permanent || isFactory,
isLazy: true,
isFactory: isFactory,
);
_registerBinding(key, info, isFactory ? 'putFactory' : 'lazyPut', tag: tag);
}