How to load data from firestore in the table form in flutter?

Viewed 24

I'm using StreamBuilder to get continuous data from firebase and I want it to be displayed in a table from. I have used DataTable with map function biut it's not working. please help. This is my Code.

 rows: [
                  snapshot.data!
                      .map<DataCell>((e) => DataRow(cells: [
                            DataCell(Text(data['Name'].toString())),
                            DataCell(Text(data['Number'].toString())),
                          ]))
                     
                ],

And I'm getting this error:

" The method 'map' isn't defined for the type 'QuerySnapshot'. Try correcting the name to the name of an existing method, or defining a > method named 'map'."

0 Answers
Related