I have some code like:
Future pushNamed = Navigator.of(context).push(MaterialPageRoute(
builder: (context) => XYZPage(),
));
pushNamed.then((_) => setState(() {}));
In general, this works fine, except for a case: in the XYZPage(), when the user clicks a button, it does a pushReplacement to another page ABCPage(). When that happens, the code above already gets to pushNamed.then. What I want instead, is to intercept the future when page ABCPage() finishes and refresh the current page before XYZPage(). Is it possible? Thanks!