As per my inforamtion,

flutter has a widget tree and an element tree.
For every stateful widget in the widget tree an element in the element tree is created with state object attached to it, that is pointing at the widget and which rebuilds the widget when we call setState(), by destroying it and replacing with a new widget.

If the widget is destroyed, then where is all the widget configuration held until new widget is replaced instead of the old one?