【问题标题】:how to access document files from firebase and show them in gridview? [closed]如何从firebase访问文档文件并在gridview中显示它们? [关闭]
【发布时间】:2020-11-17 20:44:50
【问题描述】:

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

【问题讨论】:

    标签: firebase flutter firebase-realtime-database google-cloud-firestore flutter-dependencies


    【解决方案1】:

    使用 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

    【讨论】:

      猜你喜欢
      • 2020-11-23
      • 2015-08-03
      • 1970-01-01
      • 2022-01-02
      • 1970-01-01
      • 2020-08-09
      • 2021-03-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多