title: Flutter Provider child error: Could not find the correct Provider<AuthService> above this YouBeautyApp Widget
body: <p>I'm just starting out with Flutter and Provider and I'm trying to wrap my head around rendering two different widgets depending on a user login state.</p>
  
  <p>I'm running the YouBeautyApp() as a child of ChangeNotifierProvider but I still get the following error:</p>
  
  <p>Error: Could not find the correct Provider above this YouBeautyApp Widget</p>
  
  <p>Where am I going wrong with it?</p>
  
  <p>Many tanks!</p>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'package:provider/provider.dart';
  import 'auth.dart';
  import 'home_page.dart';
  import 'login_page.dart';
  
  void main() =&gt; runApp(
    ChangeNotifierProvider&lt;AuthService&gt;(
      create: (_) =&gt; new AuthService(),
      child: YouBeautyApp(),
    ),
  );
  
  class YouBeautyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: 'You Beauty App',
        theme: ThemeData(primarySwatch: Colors.red),
        home: FutureBuilder(
          future: Provider.of&lt;AuthService&gt;(context).getUser(),
          builder: (context, AsyncSnapshot snapshot) {
            if (snapshot.connectionState == ConnectionState.done) {
              return snapshot.hasData ? HomePage() : LoginPage();
            } else {
              return Container(color: Colors.white);
            }
          },
        ),
      );
    }
  }
  </code></pre>