RtSignalWatcher
The RtSignalWatcher
widget provides a mechanism to rebuild a widget tree whenever a Signal
within its scope changes.
It acts as a listener for all Signal
instances within its subtree, triggering a rebuild when any of these signals emit new values.
Syntax
Properties
key
: An optionalKey
to use for identifying the widget.child
: An optionalWidget
that remains static while the widget tree is rebuilt. It is passed to thebuilder
function if it is defined.-
builder
: A required function that builds a widget tree based on the current state of the signals. It receives the following arguments:context
: TheBuildContext
of theRtSignalWatcher
widget.child
: Thechild
widget passed toRtSignalWatcher
.
Usage
The following example demonstrates how to use the RtSignalWatcher
widget to listen for changes in a Signal
and rebuild the widget tree accordingly.