title: Unexpected null value
body: <p>This is my homepage.dart. The error here said that there is an unexpected null value. I've been trying to debug this for the day but i still could not manage to find it, how to solve this problem? When i try to run the code. It won't shows the data from the 'Parking' which is inside the firestore database. The data was indeed there but it wont show inside this page. Can anyone help me with this ?</p>
  <pre><code>import 'package:cloud_firestore/cloud_firestore.dart';
  import 'package:flutter/material.dart';
  import 'package:fluttertoast/fluttertoast.dart';
  import 'addparking.dart';
  
  class AdminHomePage extends StatefulWidget {
    const AdminHomePage({Key? key}) : super(key: key);
    @override
    State&lt;AdminHomePage&gt; createState() =&gt; _AdminHomePageState();
  }
  
  
  
  class _AdminHomePageState extends State&lt;AdminHomePage&gt; {
    CollectionReference ref = FirebaseFirestore.instance.collection('Parking');
    //DELETE
    Future&lt;void&gt; _deleteProduct(String productId) async {
  
      await ref.doc(productId).delete();
  
      // Show a snackbar
      ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
          content: Text('You have successfully deleted a product')));
    }
    @override
    Widget build(BuildContext context) {
  
      return Scaffold(
        backgroundColor: Colors.lightBlueAccent,
        appBar: AppBar(
            backgroundColor: Color(0xFF121212),
            elevation: 0.0,
            title: const Text('Admin Page',
              style:TextStyle(
                color: Color(0xFFFFFFFF),
                fontWeight: FontWeight.bold,
              ),
            ),
            centerTitle:true,
        ),
        body: StreamBuilder(
          stream: FirebaseFirestore.instance.collection('Parking').snapshots(),
          builder: (BuildContext context, AsyncSnapshot&lt;QuerySnapshot&gt; snapshot){
            if(snapshot.hasData){
              return ListView.builder(
                  itemCount: snapshot.data!.docs.length,
                  itemBuilder: (context,index){
                    final DocumentSnapshot documentSnapshot = (snapshot.data!.docs[index]);
                      return Card(
                        margin: const EdgeInsets.all(10),
                        child: ListTile(
                          title: Text(documentSnapshot['level']),
                          subtitle: Text(documentSnapshot['parking']),
                          trailing: Row(
                            children: [
                              IconButton(
                                icon: const Icon(Icons.edit),
                                  onPressed: (){}
                              ),
                              IconButton(
                                  icon: const Icon(Icons.delete),
                                  onPressed: () =&gt; _deleteProduct(documentSnapshot.id),
                              ),
                            ],
                          ),
                        ),
                      );
  
  
  
              });
            }
              return const Center(
                child: CircularProgressIndicator(),
              );
          },
        ),
    
        drawer:  const NavigationDrawer(),
      );
  
    }
  }
    class NavigationDrawer extends StatelessWidget {
    const NavigationDrawer({Key? key}) : super(key: key);
  
  
    @override
    Widget build(BuildContext context) =&gt; Drawer(
      child: SingleChildScrollView(
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children:  &lt;Widget&gt; [
            buildHeader(context),
            buildMenuItems(context),
          ],
        ),
      ),
    );
  
    Widget buildHeader (BuildContext context) =&gt; Container(
      color: Colors.amber,
      child: InkWell(
        onTap: (){},
        child: Container(
          padding: EdgeInsets.only(
          top: 24 +  MediaQuery.of(context).padding.top,
          bottom: 24,
        ),
          child: Column(
            children: const [
              CircleAvatar(
                radius: 40,
                backgroundImage: NetworkImage(
                  'https://www.shutterstock.com/image-vector/people-icon-vector-illustration-flat-design-405042562'
                ),
              ),
              SizedBox(height: 12),
              Text(
                'Admin'
              )
            ],
          ),
        ),
      ),
    );
  
    Widget buildMenuItems (BuildContext context) =&gt; Container(
      padding: const EdgeInsets.all(24),
      child: Wrap(
        children: [
          ListTile(
            leading: const Icon(Icons.home_outlined),
            title: const Text('Home'),
            onTap:(){}
          ),
          const Divider(color: Colors.black54,),
          ListTile(
              leading: const Icon(Icons.home_outlined),
              title: const Text('Add Parking'),
              onTap:(){
                Navigator.pop(context);
                Navigator.of(context).push(MaterialPageRoute(builder: (context) =&gt; AddParking(),));
              }
          ),
          const Divider(color: Colors.black54,),
          ListTile(
              leading: const Icon(Icons.home_outlined),
              title: const Text('Delete Parking'),
              onTap:(){}
          ),
          const Divider(color: Colors.black54,),
          ListTile(
              leading: const Icon(Icons.home_outlined),
              title: const Text('Update Parking'),
              onTap:(){}
          ),
          const Divider(color: Colors.black54,),
          ListTile(
              leading: const Icon(Icons.home_outlined),
              title: const Text('Report Feedback'),
              onTap:(){}
          ),
          const Divider(color: Colors.black54,),
          ListTile(
              leading: const Icon(Icons.home_outlined),
              title: const Text('Payment Setup'),
              onTap:(){}
          ),
        ],
      ),
    );
  
  }
  </code></pre>