When dealing with streams and stream controllers in Flutter, am I forced to use Stateful Widgets to dispose the controller? or is there any other way to do so using Stateless Widgets?

This is how it's done normally in Stateful Widgets:

void dispose() {
 _myController.dispose();
 super.dispose();
}


Solution 1: harsha yarabarla

You can use provider package for flutter. It has callback for dispose where you can dispose of your blocs. Providers are inherited widgets and provides a clean way to manage the blocs with streams. With this approach you can go completely stateless.