title: Multiprovider Flutter
body: <p>Hi I'm trying to get multiproviders to work in my app where I want to be able to share a set of data across all the child widget. in This case I'm reading file on the filesystem to load a set of data (settings). </p>
  
  <p>FileService.readSettings</p>
  
  <pre><code>static Future&lt;Settings&gt; readSettings() async
    {
      try {
        final directory = await getApplicationDocumentsDirectory();
        final file = File('${directory.path}/settings.txt');
  
        String loadedstring = await file.readAsString();
        Settings settings = (jsonDecode(loadedstring) as Settings);
  
  
        return settings; 
  
      } catch (e) {
        print("Couldn't read file");
      }
    }
  </code></pre>
  
  <p>_getSetting main.dart file</p>
  
  <pre><code>Future&lt;Settings&gt; _getSettings(BuildContext context) async
    {
      Settings settings = await FileService.readSettings();
  
      return settings;
  
    }
  </code></pre>
  
  <p>My Build method snippet in main.dart</p>
  
  <pre><code>@override
    Widget build(BuildContext context) {
  
      return ChangeNotifierProvider(
        create: (context) =&gt; UserData(),
        child: MultiProvider(
          providers: [
            ChangeNotifierProvider&lt;Settings&gt;(
              create: (context)  =&gt; _getSettings(context)
            ),
  
          ],
  </code></pre>
  
  <p>I haven't composed the create method properly. I'm getting :</p>
  
  <blockquote>
    <p>Error: A value of type 'Future' can't be assigned to a
    variable of type 'Settings'.</p>
  </blockquote>
  
  <p>I'm not sure how to wait for it to load. </p>