title: Flutter: Detect state transition between widgets
body: <p>In <strong>Flutter</strong>, is there a way to detect widgets background and foreground state when a widget pushed or popped. </p>
  
  <p>For Example : 
  Let's assume there are 2 widgets A and B. </p>
  
  <p>From Widget A, launch Widget B. In this case detect Widget A's state as background and widget B's state as foreground.</p>
  
  <p>Similarly when back pressed from widget B, widget A's state should be detected as foreground.</p>