Injector constructor

Injector(
  1. List<Provider> providers, {
  2. InjectorDebugOptions? debugOptions,
  3. Injector? parent,
})

Creates a new Injector instance.

  • providers: A list of Providers that define how services are created.
  • debugOptions: Optional debugging configuration.
  • parent: An optional parent Injector. If provided, this injector will look up dependencies in the parent if they are not found locally.

Implementation

Injector(List<Provider> providers, {InjectorDebugOptions? debugOptions, Injector? parent})
    : _debugOptions = debugOptions ?? parent?._debugOptions ?? InjectorDebugOptions(),
      super() {
  _resolver = InjectorInjectableResolver(providers, _debugOptions, parentResolver: parent?._resolver);
}