What I had:
const MainWidget
- Row
-- BlocBuilderA
-- BlocBuilderB
-- BlocBuilderC
What I have now:
const MainWidget
- Row
-- const WidgetA
-- const WidgetB
-- const WidgetC
After move each BlocBuilder
to its own widget, in order to improve readability, I also got the "ability" to make these widgets consts. But after I've done that, the widget won't rebuild ever again (probabily because they are now constant). But that is an unwanted behavior in this specific use case. Is there a way to work around this or the only solution is to remove the const constructor and disable the prefer_const_constructors_in_immutables
linting in these widgets?
In my opinion, if you really want to make some widgets const then you should not wrap them with BlocBuilder. The concept of BlocBuilder is just to wrap the widget that you want to rebuild on receiving some new state. Rest are already const or I mean not going to rebuild.
I would suggest you visit this link for more info: best practices for not redrawing widget that doesn't have state change