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:

Implemented types

Constructors

RegistrationAwareBinder()

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 binders to the list of imported scopes searched during dependency resolution.
inherited
contains(Type type) bool
Returns true if type is 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 T from 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 instance as an eager singleton of type T.
inherited
runWithStrategy<T>(RegistrationStrategy strategy, T body()) → T
Executes body under the given strategy, automatically restoring the previous strategy when body completes (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 T from the parent scope.
inherited

Operators

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