title: Error: Could not find the correct Provider above this widget
body: <p>This screen is a Drawer screen which take the auth bloc in order to provide user the info and enable him of logout. 
  I got this error although I am using the correct provider </p>
  
  <pre><code>The following ProviderNotFoundError was thrown building Pets4allDrawer(dirty):
  I/flutter (32011): Error: Could not find the correct Provider&lt;AuthService&gt; above this Pets4allDrawer Widget
  I/flutter (32011): To fix, please:
  I/flutter (32011):   * Ensure the Provider&lt;AuthService&gt; is an ancestor to this Pets4allDrawer Widget
  I/flutter (32011):   * Provide types to Provider&lt;AuthService&gt;
  I/flutter (32011):   * Provide types to Consumer&lt;AuthService&gt;
  I/flutter (32011):   * Provide types to Provider.of&lt;AuthService&gt;()
  I/flutter (32011):   * Ensure the correct `context` is being used. 
  </code></pre>
  
  <p>I want to know the problem why using Provider.of(context) does not work, It can not be found while calling it.</p>
  
  <pre><code>import 'package:firebase_auth/firebase_auth.dart';
  import 'package:flutter/material.dart';
  import 'package:pets4all/blocs/authBloc.dart';
  import 'package:provider/provider.dart';
  
  class Pets4allDrawer extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      final AuthService authService = Provider.of&lt;AuthService&gt;(context);
      final user$ = authService.user.where((user) =&gt; user != null);
      return StreamBuilder&lt;FirebaseUser&gt;(
        stream: user$,
        builder: (context, snap) {
          final user = snap.data;
          if (snap.hasData) {
            return Drawer(
              child: ListView(
                children: &lt;Widget&gt;[
                  ListTile(
                    leading: Icon(Icons.person_outline),
                    title: Text(user.displayName),
                    onTap: null,
                  ),
  
                  ListTile(
                    leading: Icon(Icons.home),
                    title: Text("Home"),
                    onTap: null,
                  ),
  
  
                  Align(
                    heightFactor: 3.5,
                    alignment: Alignment.bottomLeft,
                    child: FlatButton(
                      child: Text(
                        'Log out',
                        style: TextStyle(color: Colors.redAccent),
                      ),
                      onPressed: () {
                        Navigator.pop(context);
                        authService.signOut();
                      },
                    ),
                  ),
                ],
              ),
            );
          } else {
            return CircularProgressIndicator();
          }
        },
      );
    }
  }
  
  </code></pre>
  
  <p>and this is where I am calling the drawer </p>
  
  <pre><code>class TabScreen extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      List&lt;String&gt; lol = ["questions", "events"];
      return StatefulProvider&lt;ForumServices&gt;(
          valueBuilder: (BuildContext context) =&gt; ForumServices(),
          child: Consumer&lt;ForumServices&gt;(
              builder: (BuildContext context, forumServices) {
            return StreamBuilder&lt;List&lt;String&gt;&gt;(
                stream: forumServices.forumsTypes$,
                builder: (context, snapshot) {
                  if (!snapshot.hasData) {
                    return CircularProgressIndicator();
                  }
                  List&lt;String&gt; types = snapshot.data;
                  num tabLen = types.length;
  
                  return DefaultTabController(
                    length: tabLen,
                    child: Scaffold(
                      drawer: Pets4allDrawer(),
  </code></pre>