injectSingleton<T> function

dynamic injectSingleton<T>(
  1. T dependency, {
  2. String? tag,
})

Implementation

injectSingleton<T>(T dependency, {String? tag}) {
  var plexDependency = _PlexInjector<T>.singleton(dependency, tag);
  if (_isInjected(plexDependency, tag: tag)) {
    throw Exception("This type of object is already registered in plex. If you want to register other dependency with same object Please mark it with 'Tag'");
  }
  _injectors.add(plexDependency);
}