When you first enter the page, initialize and bind the onStatus parameter statusListener. In the callback, change the state widget.
When you navigator back and enter the page again, re-execute initialize, which will execute the return successfully without overwriting the new statusListener callback. This will cause the widget changed in the callback to be the widget of the first initialized page, rather than the state widget of the current page, resulting in the inability to change the state widget of the current page.
You can only manually reassign statusListener = _statusListener, rebind the state change callback to update the state widget of the current page.
When you first enter the page,
initialize
and bind theonStatus
parameterstatusListener
. In the callback, change the state widget.When you navigator back and enter the page again, re-execute
initialize
, which will execute the return successfully without overwriting the newstatusListener
callback. This will cause the widget changed in the callback to be the widget of the first initialized page, rather than the state widget of the current page, resulting in the inability to change the state widget of the current page.You can only manually reassign
statusListener = _statusListener
, rebind the state change callback to update the state widget of the current page.