Observer<T> constructor
const
Observer<T> ({})
Creates an Observer widget.
The listenable parameter specifies which reactive variable to observe.
The listener callback builds the widget tree using the current value.
Example:
final username = Reactive<String>('Guest');
Observer<String>(
listenable: username,
listener: (name) => Text('Welcome, $name!'),
);
Implementation
const Observer({
Key? key,
required this.listenable,
required this.listener,
}) : super(key: key);