I'm working on a Flutter project and facing an issue related to widget rebuilds. I have a parent widget and a child widget. When the parent widget rebuilds due to state changes, the child widget also rebuilds, which I want to avoid. Both parent and child are statefulwidgets
I tried adding key values but that did not work
if you are using the setstate it is a normal behavior that refreshes the entire widget tree, what you could do and would be the best option is to use a state manager such as bloc, with which you have greater control of the state of each widget and thus prevent the children from being rebuilt when updating the state of the parent