ValueListenableSignalMixin is a mixin for a Readonly Signal that implements ValueListenable.
This allows you to use the signal as a ValueListenable 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 ValueListenable.