Abdulkarim
Abdulkarim

Reputation: 587

how to rebuild widget when press the back button on device

So is it possible when press the back button on the phone it will rebuild the widget that am going to like if move from widget 1 to widget 2 and then pressed the back button to back to widget 1 Is there a way o rebuild it when back to widget 1 .

Upvotes: 1

Views: 557

Answers (1)

Jorge Vieira
Jorge Vieira

Reputation: 3072

When you call the page you do:

await goToNextPage();// your navigation way
//rebuild you widget here
rebuildWidget();

the code will wait the page close to continue the code execution, then you can call safety the next lines will only run when the next page is closed.

Upvotes: 1

Related Questions