To help me better understand Flutter and Firebase, I'm making a list sharing app.
(为了帮助我更好地理解Flutter和Firebase,我正在制作一个列表共享应用程序。)
I'm working on the list home screen that will show a reorderable list tile view with a tile for each of the users' lists, I have not began to work on whats inside of these lists. (我正在使用列表主屏幕,该屏幕将显示一个可重新排序的列表图块视图,其中包含每个用户列表的图块,但我尚未开始研究这些列表中的内容。)
I have firestore set up so that each list is a sub collection, now I want to create a tile for each sub collection in that user's document ( a list of that user's lists). (我设置了Firestore,以便每个列表都是一个子集合,现在我想为该用户文档中的每个子集合(该用户列表的列表)创建一个磁贴。)
I'm having a tough time telling flutter to do something for each sub collection without using a specific sub collection's name. (我很难告诉flutter为每个子集合做一些事情而不使用特定子集合的名称。)
I wanted to pass in a list title to each tile by making a collection reference for each sub collection( list) and calling .id on each one. (我想通过为每个子collection(list)设置collection引用并在每个sub.call上调用.id来向每个tile传递列表标题。)
Using the collection ID as the title, I'm not yet sure if I can do this or if ill have to make the list title a field inside of each list. (使用集合ID作为标题,我不确定是否可以执行此操作,或者是否必须使列表标题成为每个列表中的一个字段。)
Either way, I need to find out how to do something for each subcollection inside a particular document. (无论哪种方式,我都需要找出如何为特定文档中的每个子集合做一些事情。)
.forEach seems to only work on document fields, not subcollections? (.forEach似乎仅适用于文档字段,而不适用于子集合?)
What am I doing wrong? (我究竟做错了什么?)
I'm sure there is a better way to go about this. (我相信有更好的方法可以解决此问题。)
I have not included any code as this is a big picture kind of question. (我没有包含任何代码,因为这是一个大问题。)
ask by BlueOverBrown translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…