ElementWatcher class

Helper class to track signals and effects with the lifecycle of an element.

Annotations

Constructors

ElementWatcher(int id, String label, WeakReference<Element> element)
Helper class to track signals and effects with the lifecycle of an element.

Properties

active bool
Check if the watcher is active via non empty listeners.
no setter
element WeakReference<Element>
Flutter element that is usually a widget
final
hashCode int
The hash code for this object.
no setterinherited
id int
Unique id to store with the element
final
label String
Internal label used to track the current widget
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
Dispose of the element watcher and all the listeners
listen(ReadonlySignal value, VoidCallback cb) → void
Attach a callback to the widget
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rebuild() → void
Rebuild the widget
toString() String
A string representation of this object.
inherited
unlisten(ReadonlySignal value, VoidCallback cb) → void
Stop calling the callback for a signal
unwatch(ReadonlySignal value) → void
Remove the listener of an element for a given signal
watch(ReadonlySignal value) → void
Watch a signal on am element

Operators

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

Static Methods

get(int id) ElementWatcher?
Get ElementWatcher for a given signal id