I don't mind streams for data from servers, but for event streams I don't like the complication compared to JS EventEmitter.
I avoid ValueNotifiers because they are overly complicated to use for what they do. Controllers can definitely use ChangeNotifier if you don't need granular notifications.
Well it is, but if I see a widget with a bunch of value notifiers for every property I'm gonna think someone as putting way too much logic in their widget and they should have just built a controller class. It's hard to pass around groups of value notifiers, easy to pass around a controller.
Yeah so basically the controller will hold all the Value notifiers. Then the widget will read those value notifiers from the passed controller? Or it's not what you would do?
1) In simple cases the controller is just a value notifier because that's all you need
2) In more complex cases, the controller publishes events and allows the user to subscribe to them (either via a Stream or controller provided subscription mechanism).
Comments
I avoid ValueNotifiers because they are overly complicated to use for what they do. Controllers can definitely use ChangeNotifier if you don't need granular notifications.
I'm interested in how you implement a controller 🤔
So what's your go to solution for event streams?
1) In simple cases the controller is just a value notifier because that's all you need
2) In more complex cases, the controller publishes events and allows the user to subscribe to them (either via a Stream or controller provided subscription mechanism).