类“ List <QueryDocumentSnapshot>”没有实例方法“ foreach”。接收方:“ _ GrowableList”的实例(长度:1)

时间:2020-09-27 15:12:28

标签: firebase flutter google-cloud-firestore

在这里尝试学习它是我的新手,但是却遇到了这个错误,这对任何人都很难解决。 这是我的FuturueBuilder代码,我正在做的是从firebase获取用户。

════════ Exception caught by widgets library ═══════════════════════════════════
The following NoSuchMethodError was thrown building FutureBuilder<QuerySnapshot>(dirty, state: _FutureBuilderState<QuerySnapshot>#af815):

Class 'List<QueryDocumentSnapshot>' has no instance method 'foreach'.
Receiver: Instance(length:1) of '_GrowableList'
Tried calling: foreach(Closure: (dynamic, dynamic) => Null)

以下是我得到的错误

{{1}}

0 个答案:

没有答案