As I understand, you want to access the list of user ids that are in your likes
map. In that case, you can do this:
// Get the post
final DocumentSnapshot post = await Firestore
.instance
.collection('posts')
.document(postId).get(); // Here postId is the id of the post you are accessing
// You can then get the ids list
final ids = post.data['likes'];
// Get the list of ids that has value = true
final userIds = ids.keys.map((e) => ids[e] == true).toList();
You can store likes
as an array instead of Map for convenient data handling, since this likes
field only store those that liked the post according to the name.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…