【发布时间】:2022-06-10 20:50:56
【问题描述】:
我正在制定一种从 Firebase 存储中检索图像的方法,请告诉我如何解决此错误
Future<List<Map<String, dynamic>>> _loadImage() async {
List<Map<String, dynamic>> files = [];
final ListResult result = await storage.ref('pizza').list();//Undefined name 'storage'.
Try correcting the name to one that is defined, or defining the name.
final List<Reference> allFiles = result.items;
await Future.forEach<Reference>(allFiles, (file) async {
final String fileUrl = await file.getDownloadURL();
final FullMetadata fileMeta = await file.getMetadata();
files.add({
"url": fileUrl,
});
});
return files;
}
【问题讨论】:
标签: flutter firebase dart dart-null-safety