【问题标题】:Firestore collections snapshot wont convert to csvFirestore 集合快照不会转换为 csv
【发布时间】:2020-06-09 13:28:24
【问题描述】:

我正在尝试将我的 Firestore 集合转换为 csv 格式,以便我可以在代码中通过电子邮件发送它。 我这样做的方式如下:

_sendMail() async{
List tempList = await Firestore.instance
        .collection("transactions")
        .snapshots()
        .toList();
    print(tempList.toString());
    final res = const ListToCsvConverter().convert(tempList);
    print(res.toString());
}

异步函数从不打印临时列表和 res,所以我假设它卡在集合检索部分。 我知道 firestore 集合有效,因为我在应用程序的其他部分从中检索文档。

我正在使用 csv 包转换为需要列表的 csv 格式:https://pub.dev/packages/csv

有谁知道我做错了还是有其他方法?

【问题讨论】:

    标签: flutter dart google-cloud-firestore


    【解决方案1】:

    没有卡住,即使离线,Firestore 也有离线模式,不会等待任何东西。可能 tempList 是空的,这就是您看不到任何打印内容的原因。

    【讨论】:

      猜你喜欢
      • 2019-08-13
      • 1970-01-01
      • 2018-03-18
      • 1970-01-01
      • 2020-10-26
      • 1970-01-01
      • 2023-04-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多