title: Could not find the correct Provider<List<UserData>> above this myorder Widget
body: <p>I am trying to read data using stream provider, but I am getting the error:</p>
  <blockquote>
  <p>Error: Could not find the correct Provider&lt;List&gt; above this myorder Widget</p>
  </blockquote>
  <blockquote>
  <p>This happens because you used a <code>BuildContext</code> that does not include the provider
  of your choice. There are a few common scenarios:</p>
  </blockquote>
  <blockquote>
  <ul>
  <li>You added a new provider in your <code>main.dart</code> and performed a hot-reload.
  To fix, perform a hot-restart.</li>
  </ul>
  </blockquote>
  <blockquote>
  <ul>
  <li>The provider you are trying to read is in a different route.</li>
  </ul>
  </blockquote>
  <blockquote>
  <p>Providers are &quot;scoped&quot;. So if you insert of provider inside a route, then
  other routes will not be able to access that provider.</p>
  </blockquote>
  <blockquote>
  <ul>
  <li>You used a <code>BuildContext</code> that is an ancestor of the provider you are trying to read.</li>
  </ul>
  </blockquote>
  <blockquote>
  <p>Make sure that myorder is under your MultiProvider/Provider&lt;List&gt;.
  This usually happens when you are creating a provider and trying to read it immediately.</p>
  </blockquote>
  <p>For example, instead of:</p>
  <pre><code>void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  final firestoreservice _db= firestoreservice();
  runApp(
    MultiProvider (
    providers:[
  ChangeNotifierProvider(
  create:(context)=&gt;productstore(),),
      ChangeNotifierProvider(
        create:(context)=&gt;selectedDropdownItems(),),
      ChangeNotifierProvider(
        create:(context)=&gt;userprovider(),),
      ChangeNotifierProvider(
        create:(context)=&gt;uploadProd()),
       StreamProvider(create: (BuildContext context)=&gt;_db.getUserList(), initialData: null,)
  ],
    //ChangeNotifierProvider(
    //create:(context)=&gt;productstore(),
    child: MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'ROW',
      theme: ThemeData(
  
        primarySwatch: Colors.red,
      ),
      home:users(),
    ),
  
  ),
  );
  }
  
  class UserData {
  UserData ({ this.email,this.id,this.password,this.name});
  String? email;
  String? id;
  String? password;
  String? name;
  
  
  UserData.fromJson(Map&lt;String, dynamic&gt; parsedJSON)
          :name = parsedJSON['name'],
           email = parsedJSON['email'];
  }
  
  class firestoreservice {
  FirebaseFirestore _db = FirebaseFirestore.instance;
  Stream&lt;List&lt;UserData&gt;&gt; getUserList() {
   return _db.collection('users')
       .snapshots()
       .map((snapshot) =&gt;
       snapshot.docs
           .map((document) =&gt; UserData.fromJson(document.data())).toList()
   );
  }
  
  
  }
  
  class users extends StatelessWidget{
  @override
  Widget build(BuildContext context) {
    var store = Provider.of&lt;List&lt;UserData&gt;&gt;(context,listen:false);
   
  
    return  Container(
      width: MediaQuery.of(context).size.width,
      height: MediaQuery.of(context).size.height,
      decoration: BoxDecoration( color: Colors.white,
        // border: Border.all(color: Colors.red)
      ),
      child:
      ListView(
        children: [
          Column(
            children: [
              Padding(
                padding: const EdgeInsets.only(top: 4.0,bottom: 4.0),
              ),
              ListView.builder(
                  shrinkWrap: true,
                  physics: ScrollPhysics(),
                  
                  itemCount:store.length,
                  itemBuilder:(context, index)
                  {UserData userdata= store[index];
  
                    return Padding(
                      padding: const EdgeInsets.only(top: 4.0,bottom: 4.0),
                      child: Container(
                        height: 220,
                        width: MediaQuery.of(context).size.width,
                        decoration: BoxDecoration(
                          boxShadow: [
                            BoxShadow(
                              color: Colors.black,
                              blurRadius: 2.0,
                              spreadRadius: 0.0,
                              offset: Offset(2.0, 2.0),
                            )
                          ],
                          color: Colors.white,
                          //border: Border.all(color: Colors.red)
                        ),
                        child: Column(
                          children: [
                            Row(
                              //mainAxisAlignment: MainAxisAlignment.center,
                              children: [
                                Padding(
                                  padding: const EdgeInsets.only(top: 4.0,bottom: 4.0,left: 10.0),
                                 
                                  child: Text(userdata.name.toString(),style: TextStyle(color: Colors.red,fontSize: 10, fontWeight: FontWeight.bold),),
                                ),
                                Padding(
                                  padding: const EdgeInsets.only(top: 4.0,bottom: 4.0,left: 10.0),
                                  
                                  child: Text(userdata.email.toString(),style: TextStyle(color: Colors.red,fontSize: 10, fontWeight: FontWeight.bold),),
                                ),
  
  
                              ],
                            ),
  
  
                          ],
                        ),
  
                      ),
                    );
                  }
              ),
            ],
          ),
        ],
      )
      ,
    );
  
  
  }
  }
  
  </code></pre>