更新时间:2022-04-15 22:50:35
让NetworkImage
进行下载
var ref = FirebaseStorage.instance.ref().child(fileName)
String location = await ref.getDownloadURL();
return new NetworkImage(downloadUrl);
更新
String _imageUrl;
void initState() {
super.initState();
var ref = FirebaseStorage.instance.ref().child(fileName)
ref.getDownloadURL().then((loc) => setState(() => _imageUrl = loc));
}
...
child: _imageUrl == null ? Image.asset('icons/default_profile_icon.png', height: 110.0,)
:ImageNetwork(_imageUrl,fit: BoxFit.cover,