Flutter:Firebase Cloud Storage中文件夹中的文件列表 [英] Flutter: List of files in a folder in Firebase Cloud Storage

查看:56
本文介绍了Flutter:Firebase Cloud Storage中文件夹中的文件列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从Cloud Storage加载一些图像文件.对于给定的文件夹,我需要检查其中有哪些图像(如果有的话).似乎Firebase客户端库( https://pub.dev/packages/firebase_storage )不会"没有做到这一点的简单方法.我确定ios/android客户端具有ref().list()命令.在Flutter中有什么方法可以轻松地做到这一点,或者我必须为本地方法编写一座桥梁?

I need to load some image files from Cloud Storage. For a given folder I need to check what images (if at all) are available in it. It seems like the firebase client library (https://pub.dev/packages/firebase_storage) doesn't have a simple way of doing that. I am sure ios/android clients have ref().list() command. Is there any way to do that easily in Flutter or I have to write a bridge to native methods?

推荐答案

在Cloud Storage中列出文件的方法是最近才添加到Firebase SDK的,因此似乎它们尚未移植到FlutterFire库中.

The methods to list files in Cloud Storage were only recently added to the Firebase SDKs, so it seems likely that they haven't been ported to the FlutterFire library yet.

您确实必须自己实施互操作(在这种情况下,高度赞赏返回回购的PR),或者等待其他人实施

You'll indeed either have to implement the interop yourself (in which case a PR back to the repo is highly appreciated), or wait for someone else to implement this feature request.

最后的选择是不依赖于此(相对较新的)API,而是将文件路径/下载URL列表存储在另一个数据存储中,例如Firebase Realtime Database或Cloud Firestore.

A final alternative is to not depend on this (relatively new) API, and store the list of file paths/download URLs in another data store, such as the Firebase Realtime Database, or Cloud Firestore.

这篇关于Flutter:Firebase Cloud Storage中文件夹中的文件列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆