ObserverEntry<T extends Object> class
An entry representing an observer subscription.
Stores a WeakReference to the observer and the callback to invoke. This allows automatic cleanup when the observer is garbage collected.
Constructors
- ObserverEntry({required T observer, required void callback(T self), required int id})
- Creates an observer entry.
Properties
- callback → void Function(T self)
-
The callback to invoke when notifying this observer.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → int
-
Unique identifier for this entry, used by the Finalizer.
final
- isAlive → bool
-
Returns true if the observer is still alive (not garbage collected).
no setter
- observer → T?
-
Returns the observer if still alive, null otherwise.
no setter
- 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
-
toString(
) → String -
A string representation of this object.
inherited
-
tryInvoke(
) → bool - Attempts to invoke the callback.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited