如何解决Flutter CahcedNetworkImage不显示图像
我正在尝试从firebase加载用户的个人资料图片。当我在其他小部件(即项目)上使用CachedNetworkImage时,该小部件的图像显示良好。当我在“个人资料图片”小部件上使用NetworkImage时,图片也可以正常加载(因此该网址应该可以正常工作)。
但是,当我在“个人资料图像”小部件上使用CachedNetworkImage时, CircularProgressIndicator运行,然后消失,但没有图像显示
我想知道是否在用户个人资料图像小部件中实现此功能时遗漏了某些内容?还是我应该提交的错误?
我的代码:
Column(
children: <Widget>[
Center(
child: Container(
margin: EdgeInsets.only(top: 100),child: CachedNetworkImage(
imageBuilder: (context,imageProvider) => Container(
decoration: BoxDecoration(
image: DecorationImage(
image: imageProvider,fit: BoxFit.cover,),placeholder: (context,url) =>
Container(child: CircularProgressIndicator()),imageUrl: ProfilePageView.profileImagePath,errorWidget: (context,url,error) => Icon(Icons.error),Center(
child: Container(
margin: EdgeInsets.only(top: 10),child: Text(
ProfilePageView.userFullName,overflow: TextOverflow.ellipsis,maxLines: 2,style: TextStyle(fontWeight: FontWeight.bold,fontSize: 15),Center(
child: Container(
margin: EdgeInsets.only(bottom: 50),child: Text(
ProfilePageView.userLocation,style: TextStyle(
fontWeight: FontWeight.bold,fontSize: 10,color: Colors.grey),],
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。