RegistrationAwareBinder class abstract
Contract for a Binder that can switch its RegistrationStrategy at runtime.
This is primarily used during hot reload: the engine temporarily switches to RegistrationStrategy.preserveExisting so that singleton state survives while factory closures are refreshed.
See also:
- RegistrationStrategy for the available strategies.
- Binder for the base registration/resolution API.
- Implemented types
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- registrationStrategy → RegistrationStrategy
-
The currently active RegistrationStrategy.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addImports(
List< Binder> binders) → void -
Appends
bindersto the list of imported scopes searched during dependency resolution.inherited -
contains(
Type type) → bool -
Returns
trueiftypeis registered in any reachable scope (local, imports, or parent chain).inherited -
get<
T extends Object> () → T -
Resolves a dependency of type
T.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parent<
T extends Object> () → T -
Resolves a dependency of type
Tfrom the parent scope.inherited -
registerFactory<
T extends Object> (T factory()) → void -
Registers a factory for type
T.inherited -
registerLazySingleton<
T extends Object> (T factory()) → void -
Registers a lazy singleton of type
T.inherited -
registerSingleton<
T extends Object> (T instance) → void -
Registers an already-created
instanceas an eager singleton of typeT.inherited -
runWithStrategy<
T> (RegistrationStrategy strategy, T body()) → T -
Executes
bodyunder the givenstrategy, automatically restoring the previous strategy whenbodycompletes (even if it throws). -
toString(
) → String -
A string representation of this object.
inherited
-
tryGet<
T extends Object> () → T? -
Attempts to resolve a dependency of type
T.inherited -
tryParent<
T extends Object> () → T? -
Attempts to resolve a dependency of type
Tfrom the parent scope.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited