watch method
Rebuilds this widget whenever listener notifies.
Automatically removes the listener when the widget is disposed.
Implementation
void watch(Listenable listener) {
stateOf<VoidCallback>(
() {
final VoidCallback callback = setState;
listener.addListener(callback);
return () => listener.removeListener(callback);
},
key: ObjectKey(listener),
mode: .read,
onDispose: (dispose) => dispose(),
);
}