Provider class

Defines how a dependency is provided within an Injector.

A Provider maps a token to a value, an existing dependency, or a factory.

Constructors

Provider(Object token, {List<Object>? aliasTokens, Object? fromExisting, Object? fromDerived, Object? fromValue})
Internal constructor for creating a Provider.
Provider.existing(Object token, Object existing, {List<Object>? aliasTokens})
Provides a dependency by delegating to another existing dependency.
factory
Provider.factory(Object token, {Object? fromDerived, List<Object>? aliasTokens})
Provides a dependency using a factory.
factory
Provider.value(Object token, Object value, {List<Object>? aliasTokens})
Provides a dependency as a constant value.
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
primaryToken → String
The primary token used to identify this dependency.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
strategies → Iterable<ProvideStrategy>
Returns the strategies derived from this provider configuration.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited