I have been trying to make a todo app where I have used snapshot but I'm getting error for documents.it says The property 'documents' cannot be unconditionally accessed because receiver can be 'null'

code :

```
  body: Container(
    padding: EdgeInsets.all(10),
    height: MediaQuery.of(context).size.height,
    width: MediaQuery.of(context).size.width,
    child: StreamBuilder(
      stream: Firestore.instance
          .collection('tasks')
          .document(uid)
          .collection('mytasks')
          .snapshots(),
      builder: (context, snapshot) {
        if (snapshot.connectionState == ConnectionState.waiting) {
          return Center(
            child: CircularProgressIndicator(),
          );
        } else {
          final docs = snapshot.data.documents; //facing error

```

I have also tried final docs = snapshot.data?.documents;
it give error-the getter document isn't defined for the type "object"

[enter image description here](https://i.stack.imgur.com/a1K5N.png)