May 28, 2023
Hi,
What you have done already exist since Flutter v1... It's called ValueListenable.
Moreover your solution create a singleton, so it will work with only one kind of data... Which seems to be a bad idea. Check InheritedWidget to understand how observer/observable should be handled in Flutter 😉