The solution is to pass a new Key to WidgetB every time we need it to be rebuilt : WidgetA will see that WidgetB has changed and will rebuild it when setState is called. In other words, whenever a stateful widget’s Key property changes, calling setState on its parent will force a rebuild of the stateful widget.
Read moreHow do you change the state on flutter?
setState method Null safety Notify the framework that the internal state of this object has changed. Whenever you change the internal state of a State object, make the change in a function that you pass to setState: setState(() { _myState = newValue; }); The provided callback is immediately called synchronously.
Read moreHow do you refresh current state in flutter?
Force Flutter navigator to reload state when popping
Read moreHow do I create a custom widget?
How to Create Your Own Custom Widgets
Read moreHow do I create a custom widget?
How to Create Your Own Custom Widgets
Read moreHow do you add multiple kids widgets on flutter?
Flutter multiple child layout widgets
Read moreHow do you add multiple kids widgets on flutter?
Flutter multiple child layout widgets
Read more