Injector class
Constructors
- Injector()
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
call<
T> ({String dependencyName = ""}) → T - Shorter syntax for get.
-
clearAll(
) → void - Removes all registered dependencies.
-
exists<
T> ({String dependencyName = ""}) → bool -
Checks if the dependency with the signature of
T
anddependencyName
exists. -
get<
T> ({String dependencyName = ""}) → T -
Returns the registered dependencies with the signature of
T
and the optionaldependencyName
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
register<
T> (Factory< T> factory, {bool override = false, String dependencyName = ""}) → void - Registers a dependency that will be created with the provided Factory. See Factory.provider or Factory.singleton. You can also create your custom factory by implementing Factory.
-
registerDependency<
T> (DependencyBuilder< T> builder, {bool override = false, String dependencyName = ""}) → void -
Registers the
builder
with a Factory.provider factory. -
registerSingleton<
T> (DependencyBuilder< T> builder, {bool override = false, String dependencyName = ""}) → void -
Registers the
builder
with a Factory.singleton factory. -
removeByKey<
T> ({String dependencyName = ""}) → void -
Removes the dependency with the signature of
T
anddependencyName
. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- appInstance → Injector
-
The static/single instance of the Injector.
final