LevitScopeDisposable class abstract

An interface for objects that participate in the LevitScope lifecycle.

Implement this interface to receive callbacks for initialization and disposal. This mechanism ensures deterministic cleanup when the owning scope is disposed.

// Example usage:

class MyService implements LevitScopeDisposable {
  @override
  void onInit() {
    print('Service initialized');
  }

  @override
  void onClose() {
    print('Service disposed');
  }
}
Implementers

Constructors

LevitScopeDisposable()
Creates a LevitScopeDisposable.
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
Called when the object is attached to a LevitScope.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onClose() FutureOr<void>
Called when the object is removed from the scope or the scope is disposed.
onInit() → void
Called immediately after the object is instantiated.
toString() String
A string representation of this object.
inherited

Operators

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