LevitScopeMiddleware class abstract

Interface for middleware hooks on dependency injection events.

Implement this interface to receive callbacks when dependencies are registered, resolved, or deleted across any LevitScope.

Constructors

LevitScopeMiddleware()
Base constructor.
const

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onDependencyCreate<S>(S builder(), LevitScope scope, String key, LevitDependency info) → S Function()
Called when a dependency instance is being created.
onDependencyDelete(int scopeId, String scopeName, String key, LevitDependency info, {required String source, int? parentScopeId}) → void
Called when a dependency is deleted via LevitScope.delete or LevitScope.reset.
onDependencyInit<S>(void onInit(), S instance, LevitScope scope, String key, LevitDependency info) → void Function()
Called when a dependency's onInit method is about to be executed.
onDependencyRegister(int scopeId, String scopeName, String key, LevitDependency info, {required String source, int? parentScopeId}) → void
Called when a dependency is registered via LevitScope.put, LevitScope.lazyPut or their async variants.
onDependencyResolve(int scopeId, String scopeName, String key, LevitDependency info, {required String source, int? parentScopeId}) → void
Called when a dependency is resolved (created or returned) via LevitScope.find or its variants.
onScopeCreate(int scopeId, String scopeName, int? parentScopeId) → void
Called when a new scope is created.
onScopeDispose(int scopeId, String scopeName) → void
Called when a scope is disposed.
toString() String
A string representation of this object.
inherited

Operators

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