LevitScopeDisposable class abstract
An interface for objects that require explicit lifecycle management within a LevitScope.
Implement this interface in controllers or services to participate in deterministic initialization via onInit and cleanup via onClose.
// Example usage:
class MyService implements LevitScopeDisposable {
@override
void onInit() => print('Service initialized');
@override
void onClose() => print('Service disposed');
}
Constructors
- LevitScopeDisposable()
-
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
-
didAttachToScope(
LevitScope scope, {String? key}) → void - Invoked when the instance is successfully attached to its owning LevitScope.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onClose(
) → void - Invoked when the instance is removed from the scope or the scope is disposed.
-
onInit(
) → void - Invoked after the instance is instantiated but before it is returned to the caller.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited