如何从 firebase 访问文档文件并在 gridview 中显示它们?

how to access document files from firebase and show them in gridview?

我是 flutter 的新手,我想开发一个应用程序来访问我的 firebase 目录中的所有 pdf 文件,并在我的 flutter 应用程序的网格视图中显示它们,我们可以提供任何帮助。

使用 StreamBuilder 小部件。将流 arg 设置为您希望如何接收数据的查询,然后使用构建器。

StreamBuilder(
    stream: Firestore.instance.collection("collection-name").snapshots(),
    builder: (ctx, streamSnapshot) {
            // Use streamSnapshot and widgets of your choice
        }
);

查看文档了解详情:https://api.flutter.dev/flutter/widgets/StreamBuilder-class.html