英文:
Error while fetching image from firebase storage in flutter?
问题
在从Firebase存储获取图像时,出现错误。我已经编写了以下代码:
body: FirebaseAnimatedList(
query: dbRef.child('Post List'),
itemBuilder: (context, snapshot, animation, index) {
return Container(
child: FadeInImage.assetNetwork(
placeholder: 'assets/icon.png',
image: snapshot.value['pImage'],
),
);
},
)
它抛出以下错误:
assert(() {
if (widget.errorBuilder == null) {
// ignore: only_throw_errors, since we're just proxying the error.
throw error; // Ensures the error message is printed to the console.
}
return true;
}
英文:
I am creating blog app and during fetching image from firebase storage it throws error.
I have written the following code:
body: FirebaseAnimatedList(
query: dbRef.child('Post List'),
itemBuilder: (context, snapshot, animation, index) {
return Container(
child: FadeInImage.assetNetwork(
placeholder: 'assets/icon.png',
image: "snapshot.value['pImage']"),
);
},
)
It throws following error:
assert(() {
if (widget.errorBuilder == null) {
// ignore: only_throw_errors, since we're just proxying the error.
throw error; // Ensures the error message is printed to the console.
}
return true;
答案1
得分: 1
image: "snapshot.value['pImage']"),
这是错误的原因。从这里移除""。或者:
image: "${snapshot.value['pImage']}"),
英文:
image: "snapshot.value['pImage']"),
I think that is the cause of error. Remove "" from here. Or:
image: "${snapshot.value['pImage']}"),
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论