我正在显示图像从firebase云存储到flutter应用程序通过流构建器。我正在显示图像在警报对话框时,按下按钮。图片显示在调试模式罚款,但不显示在释放模式。我已经尝试获得apk与--no-shrink,但错误仍然相同。我的功能是当用户选择月份和年份从下拉菜单,并按下按钮,图片显示在该月的警报对话框中,并保存在云存储中。Picture in release apkPicture in debug mode
**Future showimage() async {
return showDialog(
context: context,
builder: (BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width * 0.9,
height: MediaQuery.of(context).size.height * 0.8,
child: AlertDialog(
content: Expanded(
child: FutureBuilder(
future: storage.downloadedUrl('${dropdownmonth}${dropdowndate}', '${dropdownmonth}${dropdowndate}Record'),
builder: (BuildContext context, AsyncSnapshot<String> snap) {
if (snap.connectionState == ConnectionState.done &&
snap.hasData) {
return Expanded(
child: ListView.builder(
itemCount: 1,
itemBuilder: (BuildContext context, index) {
return Container(
width: 400,
height: 450,
child: Image.network(
snap.data!,
fit: BoxFit.cover,
));
}),
);
//Container(width: 300,height: 450,
// child: Image.network(snap.data!,
// fit: BoxFit.cover,),
}
if (snap.connectionState == ConnectionState.waiting) {
return Center(child: CircularProgressIndicator());
}
if(snap.data==null){
return Center(child: Text("No Report Found"));
}
return Container();
},
),
)),
);
});
}**
2条答案
按热度按时间pbwdgjma1#
这个问题是通过删除一些小部件如expanded,flex来解决的。我在发布状态下通过flutter run --release运行了更新
0lvr5msh2#
将blow中的行添加到
AndroidManifest.xml
中大概是这样的: