List<DocumentSnapshot> docs = snapshot.data.docs; _selectedSubjects = docs .map( (doc) => Subject( doc['SubjectName'].data(), doc['courseIcon'].data(), doc['courseCode'].data(), ), ) .toList(); I have a class called subject that has attributes/members courseCode, courseIcon, and lastly subjectName. Everything is okay so far, but vs code is saying:
Type: dynamic
The property 'docs' can't be unconditionally accessed because the receiver can be 'null'. Try making the access conditional (using '?.') or adding a null check to the target ('!')."
I have already imported all the necessary libraries, as well as vs code's reccomendations. What should I try?