Q:

Which function is called when a screen is opened after popping from navigation stack?

I have 2 screens - screen A and screen B. I navigate from screen A to screen B.
I want to take some particular action when I am coming BACK to screen A by popping out screen B from the navigation stack. 
I know I can use didUpdateWidge but I can't figure out an efficient way of doing it.
Is using Inherited Widget the correct way here?

A:

Navigator.push[Named] returns a Future that completes when screen B pops. So add the code you want to execute after the pop to then.
  Navigator.pushNamed(context, '/someRoute').then((_) {/* do stuff here */});

