ServiceLocator class
A simple service locator for managing singleton and factory instances.
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
-
clear(
) → void - Clears all singleton instances.
-
create<
T> () → T -
Creates a new instance of type
T
every time it is called. -
locate<
T> () → T -
Locates a singleton instance of type
T
. If it doesn't exist, it creates one using the registered factory. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
register<
T> (T creator()) → void -
Registers a factory function for creating instances of type
T
. -
remove<
T> () → void -
Removes the singleton instance of type
T
. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- I → ServiceLocator
-
final