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 moreWhat is did update widget Flutter?
didUpdateWidget method Null safety key, the framework will update the widget property of this State object to refer to the new widget and then call this method with the previous widget as an argument . Override this method to respond when the widget changes (e.g., to start implicit animations).
Read moreWhat is did update widget Flutter?
didUpdateWidget method Null safety key, the framework will update the widget property of this State object to refer to the new widget and then call this method with the previous widget as an argument . Override this method to respond when the widget changes (e.g., to start implicit animations).
Read moreHow do I force a widget to rebuild in Flutter?
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 more