flutterdartgorouter

Refresh the back page when the device back button is clicked in flutter in go router package


I have two pages and I want to refresh the previous page when the device back button is pressed, it is possible to do that in default navigation with async-await, but I can not do it with the go router package, can anyone suggest smth with GO ROUTER PACKAGE in flutter?


Solution

  • you can wait until the screen is close by writing

    await Navigator.of(context).push(MaterialPageRoute(builder: (context) => YourScreen()));
    doRefresh();