lazyPut<S> static method

S lazyPut<S>(
  1. S builder(), {
  2. String? tag,
  3. bool permanent = false,
})

Lazy registration

Implementation

static S lazyPut<S>(S Function() builder, {String? tag, bool permanent = false}) {
  final type = S;
  if (!_dependencies.containsKey(type)) {
    _dependencies[type] = {};
  }
  _dependencies[type]![tag] = _InstanceBuilder(
    builder: builder,
    permanent: permanent,
  );
  return find<S>(tag: tag);
}