I'm experiencing a quite not stable respond in getting my array of data. I'm showing this data in a list of card. I'm saying not stable because everytime I go to another navigation in my app then I'll go back to that nav where I output my data. It shows a red back ground first then for a mil of seconds it shows the data. Anyone know how to fix this? I'm just new in flutter / android. Please help.
For the red background it shows this on terminal and output the data that I'm getting.
The following NoSuchMethodError was thrown building StreamBuilder<QuerySnapshot>(dirty, state: _StreamBuilderBaseState<QuerySnapshot, AsyncSnapshot<QuerySnapshot>>#dac03):
The getter 'documents' was called on null.
Receiver: null
Tried calling: documents
My code:
StreamBuilder<QuerySnapshot>(
stream: db.collection('ACTIVITIES').snapshots(),
builder: (context, snapshot) {
final issuesList = snapshot.data.documents
.map((doc) => doc['Issue'].map<Widget>((issue) => buildItem(issue)).toList())
.toList();
return Column(
children: issuesList.expand<Widget>((issue) => issue).toList()
);
})
My db structure:
Please Help.
