ValueNotifierSignalMixin is a mixin for a Readonly Signal that implements ValueNotifier.
This allows you to use the signal as a ValueNotifier in Flutter widgets.
When addListener
is called it will subscribe to the signal and call the listener when the signal changes.
When removeListener
is called with the same method it will unsubscribe from the signal.
When the signal is disposed it will remove all listeners.
ValueListenableBuilder
In Flutter you can use the ValueListenableBuilder
widget to listen to a ValueNotifier.