我正在构建一个 flutter 应用程序并使用 cloud-firestore,这就是我的数据库的样子

我想要一个函数,它在一个字符串数组中检索名为“驱动程序列表”的集合中的所有文档,这些文档是我已经使用过的,但它会将它们返回到新屏幕的列表视图中
class DriverList extends StatelessWidget {@overrideWidget build(BuildContext context) {
return new StreamBuilder<QuerySnapshot>(
stream: Firestore.instance.collection('DriverList').snapshots(),
builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot) {
if (!snapshot.hasData) return new Text('Loading...');
return new ListView(
children: snapshot.data.documents.map((DocumentSnapshot document) {
return new ListTile(
title: new Text(document['name']),
subtitle: new Text(document['phone']),
);
}).toList(),
);
},
);
Run Code Online (Sandbox Code Playgroud)
} }