title: How to refresh currently active page in flutter
body: <p>I have a global function that I call from almost all screens of my app. I am passing context to it. I just want to know if there is a way to refresh the page from which the global function is called depending on context passed to the function?</p>
  
  <pre><code>appResumedPausedLogic(context,[bool isVisitPage]){
    SystemChannels.lifecycle.setMessageHandler((msg)async{
  if(msg=='AppLifecycleState.resumed' )
  {
    print("------------------------------------ App Resumed-----------------------------");
  
    var serverConnected= await checkConnectionToServer();
    if(globals.globalCameraOpenedStatus==false)
      if(serverConnected!=1){
  
        Navigator.pushReplacement(context, MaterialPageRoute(builder: (context) =&gt; OfflineHomePage()));
  
      }
      else{
        Navigator.push(context, MaterialPageRoute(builder: (context) =&gt; HomePage()));
      }
  
  
  
  }
  if(msg=='AppLifecycleState.paused' ){
    if(globals.globalCameraOpenedStatus==false)
    locationThreadUpdatedLocation=false;
  }
  
    });
  }
  </code></pre>
  
  <p>My global function redirects users to offline home/home page depending on availability of internet when app is resumed currently. I want it to refresh the currently active screen.  </p>
  
  <p>Thanks in advance!</p>