title: Flutter , type 'Null' is not a subtype of type 'String'
body: <p>I am getting this error and I don't know why,
  <strong>type 'Null' is not a subtype of type 'String'
  The relevant error-causing widget was
  StreamBuilder&lt;QuerySnapshot&lt;Object?&gt;&gt;</strong></p>
  <pre><code>import 'package:cloud_firestore/cloud_firestore.dart';
  import 'package:flutter/material.dart';
  import 'package:market_app/data/Models/single_product_class.dart';
  import 'package:market_app/persentation/menu_screens/add_windows_screen.dart';
  
  class WindowsScreen extends StatefulWidget {
    const WindowsScreen({Key? key}) : super(key: key);
  
    @override
    State&lt;WindowsScreen&gt; createState() =&gt; _WindowsScreenState();
  }
  
  class _WindowsScreenState extends State&lt;WindowsScreen&gt; {
    CollectionReference windowsCollection =
        FirebaseFirestore.instance.collection(&quot;Products&quot;);
    List&lt;Product&gt; window = [];
    // WindowsProvider().windows;
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        floatingActionButton: FloatingActionButton(
          onPressed: () {
            Navigator.of(context).push(MaterialPageRoute(
                builder: (contextt) =&gt; const AddWindowsScreen()));
          },
          child: const Icon(Icons.add),
          backgroundColor: Colors.blueAccent,
        ),
        body: StreamBuilder&lt;QuerySnapshot&gt;(
            stream: windowsCollection.snapshots(),
            builder: (context, snapshot) {
              for (var document in snapshot.data!.docs) {
                Map&lt;String, dynamic&gt; productFromFStore =
                    document.data()! as Map&lt;String, dynamic&gt;;
                
                window.add(Product.fromJson(productFromFStore));
                // window.last.id = document.id;
  
              }
              if (snapshot.connectionState == ConnectionState.waiting) {
                return const Center(
                  child: CircularProgressIndicator(),
                );
              } else if (snapshot.connectionState == ConnectionState.done &amp;&amp;
                  snapshot.data == null) {
                return const Center(
                  child: Text(&quot; no data to be showen &quot;),
                );
              } else if (snapshot.hasError) {
                return const Text('Something went wrong');
              }
  
              return GridView.builder(
                gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
                    crossAxisCount: 2),
                itemBuilder: (context, i) =&gt; GridTile(
                  header: ListTile(
                    leading: IconButton(
                      icon: const Icon(Icons.favorite),
                      onPressed: () {},
                    ),
                    trailing: IconButton(
                      icon: const Icon(Icons.shopping_cart_outlined),
                      onPressed: () {},
                    ),
                  ),
                  child: Image.network(window[i].imageUrl,
                      fit: BoxFit.cover),
  
                  // footer: Row(
                  //   children: [
                  //     Text(windows[i].name),
                  //     const Spacer(
                  //       flex: 1,
                  //     ),s
                  //     // Text(windows[i].price)
                  //   ],
                  // ),
                ),
                itemCount: snapshot.data?.docs.length,
              );
            }),
      );
    }
  }
  </code></pre>
  <p><strong>This is product model:</strong></p>
  <pre><code>  import 'package:cloud_firestore/cloud_firestore.dart';
  
  class Product {
    final String name;
    final String description;
    late String id;
    final double price;
    final int amount;
    final String imageUrl;
  
    Product(
        {required this.name,
        required this.description,
        required this.price,
        required this.amount,
        required this.imageUrl,
        id});
  
    factory Product.fromJson(Map&lt;String, dynamic&gt; data) {
      return Product(
        name: data[&quot;name&quot;] ,
        description: data[&quot;description&quot;],
        price: double.parse(data[&quot;price&quot;]),
        amount: int.parse(data[&quot;amount&quot;]),
        imageUrl: data[&quot;imageUrl&quot;],
        id: data[&quot;id&quot;],
      );
    }
    factory Product.fromSnapshot(DocumentSnapshot snap) {
      Map&lt;String, dynamic&gt; data = snap.data()! as Map&lt;String, dynamic&gt;;
      return Product(
        name: data[&quot;name&quot;],
        amount: int.parse(data[&quot;amount&quot;]),
        description: data[&quot;description&quot;],
        imageUrl: data[&quot;imageUrl&quot;],
        price: double.parse(data[&quot;price&quot;]),
        id: data[&quot;id&quot;],
      );
    }
  
    Map&lt;String, dynamic&gt; toMap(Product product) {
      return {
        &quot;name&quot;: name,
        &quot;description&quot;: description,
        &quot;price&quot;: price,
        &quot;amount&quot;: amount,
        &quot;imageUrl&quot;: imageUrl,
        &quot;id&quot;: id,
      };
    }
  }
  </code></pre>
  <p><strong>I have tried other ways to get the data like // child: Image. network(
  snapshot.data!.docs[index].data().toString())
  but I have got only String, still, I don't know how to fix it, so I need some help</strong></p>