【问题标题】:Displaying images from firebase to flutter app [closed]将图像从 firebase 显示到颤振应用程序 [关闭]
【发布时间】:2020-09-03 12:47:45
【问题描述】:

我想知道如何使用列表视图将存储在 firebase 中的图像显示到我的颤振应用程序中。请简要说明如何进行。例如,烘焙产品图像要从 Firebase 显示到我的烘焙应用程序以及价格。请大家帮忙

【问题讨论】:

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


【解决方案1】:

获取特定图片的网址:

final ref = FirebaseStorage.instance.ref().child('nameofimage');
// no need of the file extension, just the name does the job
var url = await ref.getDownloadURL();
print(url);

当你有 URL 时,你可以使用它:

Image.network(url);

【讨论】:

  • 您好,如果我有很多图像要在列表视图中显示,可以这样吗?
  • 这应该可以。只需将图像的名称与将要加载的其他信息一起保存即可。
猜你喜欢
  • 1970-01-01
  • 2019-08-01
  • 2020-01-26
  • 2019-02-01
  • 2022-10-09
  • 2021-05-24
  • 2020-11-15
  • 2022-01-08
相关资源
最近更新 更多