title: The getter 'docs' isn't defined for the type 'DocumentSnapshot<Map<String, dynamic>>
body: <pre><code>import 'package:cloud_firestore/cloud_firestore.dart';
  import 'package:firebase_core/firebase_core.dart';
  import 'package:flutter/material.dart';
  
  class ListStudentPage extends StatefulWidget {
    State&lt;StatefulWidget&gt; createState() {
      return _ListStudentPage();
    }
  }
  
  class _ListStudentPage extends State&lt;ListStudentPage&gt; {
    final Stream&lt;DocumentSnapshot&lt;Map&lt;String, dynamic&gt;&gt;&gt; productsStream =
        FirebaseFirestore.instance
            .collection('Categories')
            .doc('Pharmacy')
            .snapshots();
  
    @override
    Widget build(BuildContext context) {
      return StreamBuilder&lt;DocumentSnapshot&lt;Map&lt;String, dynamic&gt;&gt;&gt;(
          stream: productsStream,
          builder: (BuildContext context,
              AsyncSnapshot&lt;DocumentSnapshot&lt;Map&lt;String, dynamic&gt;&gt;&gt; snapshot) {
            if (snapshot.hasError) {
              print('Something went Wrong');
            }
            if (snapshot.connectionState == ConnectionState.waiting) {
              return Center(child: CircularProgressIndicator());
            }
            final List productDocs = [];
            snapshot.data!.docs.map((DocumentSnapshot document) {
              Map a = document.data() as Map&lt;String, dynamic&gt;;
              productDocs.add(a);
              a['id'] = document.id;
            }).toList();
          });
    }
  }
  </code></pre>
  <p>I am getting this error &quot;The getter 'docs' isn't defined for the type 'DocumentSnapshot&lt;Map&lt;String, dynamic&gt;&gt;&quot; in the line right below( snapshot.data!.docs.map((DocumentSnapshot document,docs here is highlighted with a red underline)
  ) , where I created an empty list , can anyone please tell me why I am getting this error and how can I fix it .</p>