ServiceSubscription class

Manages the connection between a Service and the elements depending on it.

This class acts as a bridge that registers event listeners, tracks active watchers and readers, and disposes of the service once it has no dependents.

Constructors

ServiceSubscription({required Service service, required VoidCallback listener})

Properties

hashCode → int
The hash code for this object.
no setterinherited
listener → VoidCallback
The callback listener that triggers whenever the service notifies changes.
final
readers → Set<Element>
Elements only reading this service.
final
referenceCount → int
The total number of dependent elements (both readers and watchers) relying on this service.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
service → Service
The active service instance being managed.
final
watchers → Set<Element>
Elements actively watching this service.
final

Methods

cancel() → void
Unbinds the listener from the service, stopping any future update notifications.
dispose() → void
Cancels the subscription and releases all resources associated with the service.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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