I try display data from firestore using image url. i use FutureBuilder for get my image url value from firestore. but i have problem because my image cannot display and show red screen. i got messages in my debug console like :
Another exception was thrown: A build function returned null.
I/flutter (13506): Another exception was thrown: NoSuchMethodError: The method '[]' was called on null.
I/flutter (13506): Another exception was thrown: NoSuchMethodError: Class 'QuerySnapshot' has no instance method '[]'
and this my code :
ListTile(
leading: new FutureBuilder(
future: Firestore.instance.collection('users').where('uid', isEqualTo: _post['imgurl']).getDocuments(),
builder: (BuildContext context, AsyncSnapshot snapshot){
if(snapshot.hasData){
if(snapshot.data != null){
print(snapshot.data['imgurl']);
return CircleAvatar(
backgroundImage: NetworkImage(snapshot.data['imgurl']),
);
}
}
},
),
title: Text('Richard');
)
can you tell me where is my fault?