I encounter an error like this in flutter with firestore. The ItemList is class I’ve defined.
Error: The widget ItemList tried to read Provider<QuerySnapshot<Object?>> but the matching
provider returned null.
To fix the error, consider changing Provider<QuerySnapshot<Object?>> to Provider<QuerySnapshot<Object?>?>.
The error code is derieved from below.
final items = Provider.of<QuerySnapshot>(context);
This error appear in the beggining.
after a second, the printing the items works properly
for ( var doc in items.docs) {
print(doc.data());
}