Injector<T> class
A class that injects dependencies into a function.
You must provide T if you wanna inject an abstract class.
Otherwise, it will be inferred from the create function.
Constructors
Properties
- create → Function
-
The
Tfunction to inject.final - hashCode → int
-
The hash code for this object.
no setterinherited
- hasParams → bool
-
Whether create has parameters.
If false, we can treat it as a ValueGetter of
T.latefinal - ignorePrivateTypes → bool
-
Whether to ignore private types.
final
- isAsync → bool
-
Whether the create function is async.
no setter
- locator → ParamLocator?
-
The locate args by
Paramwhile injecting.final -
namedParams
→ List<
NamedParam> -
Named parameters of the constructor.
no setter
-
parameters
→ Map<
String, dynamic> ? -
The arguments values to use while injecting.
Example:
final
-
params
→ List<
Param> -
All parameters of the constructor.
no setter
-
positionalParams
→ List<
PositionalParam> -
Positional parameters of the constructor.
no setter
- rawType → String
-
The inferred
Ttype of Injector. Fallbacks to returnType whenTis generic.latefinal - returnType → String
-
The return type of create function.
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → String
-
The return type of create function.
latefinal
Methods
-
call(
[Map< String, dynamic> ? parameters]) → FutureOr<T> - Performs the injection.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
splitParams(
String input) → List< String> -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- defaultLocator ↔ ParamLocator?
-
The default ParamLocator to use. Applied to all Injector.
getter/setter pair