Describes at compile-time how an Injector should be generated.

A Provider is a binding between a token and an implementation that may be provided either by invoking a constructor, a function, or referring to a literal value.

Implements
  • RuntimeProvider<T>
Annotations
  • @optionalTypeArgs

Constructors

Provider(Object token, { Type useClass, Object useValue, Object useExisting, Function useFactory, List<Object> deps, bool multi })
const
factory

Properties

dependencies → List<Object>
If provided, determines what dependencies are injected into useFactory.
read-only, inherited
hashCode → int
The hash code for this object. [...]
read-only, inherited
multi → bool
If true, providers are collected as a List instead of a single instance.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited
token → Object
Either a Type or OpaqueToken that is an identifier for this provider.
read-only, inherited
useClass → Type
If provided, creates an instance of this class to satisfy this dependency.
read-only, inherited
useExisting → Object
If provided, returns the same instance as if this token was provided.
read-only, inherited
useFactory → Function
If provided, invokes this method to satisfy this dependency.
read-only, inherited
useValue → Object
If provided, uses this constant value to satisfy this dependency.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(other) → bool
The equality operator. [...]
inherited