Flutterfire: FireStore plugin doesn't expose document ID

Created on 13 Oct 2019  路  1Comment  路  Source: FirebaseExtended/flutterfire

According to the documentation you can do something like this:

db.collection("cities").get().then(function(querySnapshot) {
    querySnapshot.forEach(function(doc) {
        console.log(doc.id, " => ", doc.data());
    });
});

The flutter example does this

          children: snapshot.data.documents.map((document) {
            return new ListTile(
              title: new Text(document['title']),
              subtitle: new Text(document['author']),
            );

This is almost the same, but with flutter you already have the data of the document. The FireStore plugin should also expose the document ID.

Most helpful comment

what's the solution?

>All comments

what's the solution?

Was this page helpful?
0 / 5 - 0 ratings