title: Setting a provider in widget init is not working
body: <p>I'm trying to set a provider variable when a widget gets initialized so that the widget has the appropriate data. I get an error when doing that. Here's the code:</p>
  
  <pre><code>class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return ChangeNotifierProvider(
        builder: (context) =&gt; ListManager(),
        child: MaterialApp(
          title: 'crud-to-do',
          home: Home(), // Home calls ListWidget()
        ),
      );
    }
  }
  
  class ListWidget extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      final listManager = Provider.of&lt;ListManager&gt;(context);
        listManager.list = [
          ListItem(title: 'myTtitle', description: 'My desc', id: '1324j323e')
        ];
  
      if (listManager.list.isEmpty) return Text("hey");
      return Text(listManager.list[0].title);
    }
  }
  </code></pre>
  
  <p>This works, but I get an error:</p>
  
  <pre><code>flutter: ══╡ EXCEPTION CAUGHT BY FOUNDATION LIBRARY ╞════════════════════════════════════════════════════════
  flutter: The following assertion was thrown while dispatching notifications for ListManager:
  flutter: setState() or markNeedsBuild() called during build.
  flutter: This ChangeNotifierProvider&lt;ListManager&gt; widget cannot be marked as needing to build because the
  flutter: framework is already in the process of building widgets.  A widget can be marked as needing to be
  flutter: built during the build phase only if one of its ancestors is currently building. This exception is
  flutter: allowed because the framework builds parent widgets before children, which means a dirty descendant
  flutter: will always be built. Otherwise, the framework might not visit this widget during this build phase.
  flutter: The widget on which setState() or markNeedsBuild() was called was:
  flutter:   ChangeNotifierProvider&lt;ListManager&gt;
  flutter: The widget which was currently being built when the offending call was made was:
  flutter:   ListWidget
  flutter:
  flutter: When the exception was thrown, this was the stack:
  flutter: #0      Element.markNeedsBuild.&lt;anonymous closure&gt; 
  package:flutter/…/widgets/framework.dart:3680
  flutter: #1      Element.markNeedsBuild 
  package:flutter/…/widgets/framework.dart:3695
  flutter: #2      State.setState
  </code></pre>
  
  <p>So I therefore tried wrapping an <code>initState</code> around the setting of <code>listManager.list</code> like this:</p>
  
  <pre><code>@override
  void initState() {
    listManager.list = [
          ListItem(title: 'myTtitle', description: 'My desc', id: '1324j323e')
    ];
  }
  </code></pre>
  
  <p>But I get an error saying:</p>
  
  <blockquote>
    <p>The declaration 'initState' isn't referenced.</p>
  </blockquote>
  
  <p>What am I doing wrong in both cases, and what's the correct way of setting a <code>provider</code>?</p>