Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 颤振-类“QuerySnapshot”没有实例方法“document”_Flutter_Snapshot_Stream Builder - Fatal编程技术网

Flutter 颤振-类“QuerySnapshot”没有实例方法“document”

Flutter 颤振-类“QuerySnapshot”没有实例方法“document”,flutter,snapshot,stream-builder,Flutter,Snapshot,Stream Builder,我得到以下错误: ════════ widgets库捕获到异常 ═══════════════════════════════════════════════════════ 以下NoSuchMethodError在生成时抛出 StreamBuilderdirty,州: _StreamBuilderBasState>f469b:类“QuerySnapshot”没有 实例方法“document”。接收者:“QuerySnapshot”的实例 尝试呼叫:文档+918130343322 _mymob

我得到以下错误:

════════ widgets库捕获到异常 ═══════════════════════════════════════════════════════

以下NoSuchMethodError在生成时抛出 StreamBuilderdirty,州: _StreamBuilderBasState>f469b:类“QuerySnapshot”没有 实例方法“document”。接收者:“QuerySnapshot”的实例 尝试呼叫:文档+918130343322


_mymobile是文档ID。

此代码返回一个列表snapshot.data.documents而不是文档

如果你想这样做,你需要尝试这样做

final specificDocument = snapshot.data.documents.where((f) {
     return f.documentID == _myMobile;
}).toList();
final specificDocument = snapshot.data.documents.where((f) {
     return f.documentID == _myMobile;
}).toList();