title: alternate to call initState multiple times? [Flutter]
body: <p>I have a pageview widget present in class1. the class1 also has a constructor with a variable which dynamically changes based on which page the user is in (e.g. for page1 variable value will be 1, for page 2, variable value will be 2, etc.). I also have a global variable which is supposed to hold the variable value from class1 constructor and it is supposed to change dynamically along with the pageview variable. I have defined this function </p>
  
  <pre><code>settermethod(){
    setter = widget.makeTextString;
  }
  </code></pre>
  
  <p>to set the global variable to the constructor variable. When i placed this function inside the initState function, The setter variable gets updated as long as I navigating to a new page inside pageview but when i go back to pages which i have already visited, the setter will have the value of the last page i have visited.
  I essentially need something like calling initState everytime i am navigating to any page inside pageview but i am a bit lost on what approach to use.</p>