title: How to access provider value in Init state
body: <p>How do I access the value in a provider model from the init function or a workaround?</p>
  
  <p>Basically, when my App loads, I save some value in a provider model. </p>
  
  <p>One value is a search variable. Then I am redirected to a loading page where I need this value to get the data and render a list.</p>
  
  <p>I am retrieving the data in the init method.</p>
  
  <p>-- My Main function </p>
  
  <pre class="lang-dart prettyprint-override"><code>void main() {
    runApp(
     Provider&lt;UserModel&gt;(
        builder: (_) =&gt; UserModel(),
        child: Jobs(),
      ),
    ); //added
  }
  </code></pre>
  
  <p>This is a snippet of my Jobs page</p>
  
  <pre class="lang-dart prettyprint-override"><code>case '/main':
     return MaterialPageRoute(
        builder: (_) =&gt; JobsHomePage(title: "jobs"));
     break;
  </code></pre>
  
  <p>This is list page that displays this list
   --- JobsHomePage()</p>
  
  <pre class="lang-dart prettyprint-override"><code>void initState() {
      searchVal = Provider.of&lt;UserModel&gt;(context).searchVal;
      jb =load(searchVal);
  }
  </code></pre>
  
  <p>Then I have a builder method that iterates thru 'jb' and prints the value</p>
  
  <p>The error I am getting is inherited error</p>
  
  <p>flutter: When an inherited widget changes, for example, if the value of Theme.of() changes, it's dependent</p>
  
  <p>Thanks for your help... I did not post the entire code because it is very long and I get some "all code" error in the stack.</p>