'Flutter, The element type 'List<ListTile>' can't be assigned to the list type 'Widget'
I tried geting data from firebase and display it using streamBuilder but I get this error, how do I solve it.
body:
StreamBuilder<QuerySnapshot>(
stream: firestore.collection('paymnet data').snapshots(),
builder: (context, snapshot) {
return ListView(
children: [
snapshot.data!.docs.map((DocumentSnapshot document){
Map<String,dynamic> data = document.data()! as Map<String, dynamic>;
return ListTile(
title: Text(data['amount']),
subtitle: Text(data['paid date']),
);
}).toList();
],
);
})
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
