provide top-level constant

Provide const provide

Annotation for a method (in an Injector or module), class, or constructor that provides an instance.

  • If the annotation is on a class or constructor, the class is entered into the dependency graph and its constructor's arguments are injected when the class is injected.
  • If the annotation is on a method in a module, the return type is entered into the dependency graph. The method will be executed with injected arguments when the return type is injected.
  • If the annotation is on an Injector, this indicates that the injector should provide instances of the type when the method is called.

The type provided by this annotation can be further specified by including a Qualifier annotation.

Implementation

const provide = const Provide._();