injectScoped<T> function

dynamic injectScoped<T>(
  1. T builder(), {
  2. required String scope,
  3. String? tag,
})

Implementation

injectScoped<T>(T Function() builder, {required String scope, String? tag}) {
  final list = _scopedInjectors.putIfAbsent(scope, () => []);
  var plexDependency = _PlexInjector<T>.singletonLazy((parm) => builder(), tag);
  if (_isInjectedScoped<T>(list, tag: tag)) {
    throw Exception("This type of object is already registered in scope '$scope'. If you want to register other dependency with same object Please mark it with 'Tag'");
  }
  list.add(plexDependency);
}