title: Provider/ChangeNotifier: Set state after Widget is build
body: <p>Im using the Provider/ChangenNotifier Pattern to handle state as described <a href="https://flutter.dev/docs/development/data-and-backend/state-mgmt/simple" rel="nofollow noreferrer">in the official docs</a>.</p>
  
  <p>I have a state field which I want to set after a Widget is build. However if I try to set in in the build method. I get an Error:</p>
  
  <blockquote>
    <p>setState() or markNeedsBuild() called during build.</p>
  </blockquote>
  
  <p>Where can I call something like:</p>
  
  <pre><code>var state = Provider.of&lt;StateModel&gt;(context);
  state.field = 'new Val';
  </code></pre>