Flutter BLoC: Is using nested StreamBuilders a bad practice?

Posted by Rohit Kumar | Updated on

Flutter BLoC: Is using nested StreamBuilders a bad practice. You cannot do otherwise using widgets. That’s one of the limitations of the widget system: things tend to get pretty nested

There’s one solution though: Hooks, a new feature coming from React, ported to Flutter through flutter_hooks (I’m the maintainer).

The end result becomes this:

This behaves exactly like two nested StreamBuilder, but everything is done within the same without and without nesting.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers