I need to reload page after Get.back(). How to do it? How to call any method on previous page as soon as possible after using Get.back()? For example:
- I'm on
Page1
- Go to
Page2
- Use Get.back(), so user back to
Page1
- Usually user now see
Page1
exactly like when he leavePage1
. How to reload now viewPage1
?
Maybe is any method to override what I can call every time after navigate one page back? This method must come from Page1
, not from Page2
CodePudding user response:
you can do await while navigating to page 2.
Example:
await Get.to(()=> Page2());
setState({
// perform update
});
the setState will get fired once you come back to page 1 from page 2
CodePudding user response:
on Page 2: You need to write this
Get.back(result: true);
on Page 1: wait for response
var response = await Get.to(()=> Page2());
if(response){setState({
// perform update
});}