Flutter 颤振:在警报对话框中显示资产gif
我试图在警报对话框中显示此gif资源,但出现错误:Flutter 颤振:在警报对话框中显示资产gif,flutter,dialog,gif,Flutter,Dialog,Gif,我试图在警报对话框中显示此gif资源,但出现错误: Another exception was thrown: Unable to load asset: assets/tutorial/lip.gif 但是.png图像效果很好 以下是我的警报对话框代码: ... AlertDialog( title: Text('Showing Lip'), content: Container( child: Image.asset(
Another exception was thrown: Unable to load asset: assets/tutorial/lip.gif
但是.png图像效果很好
以下是我的警报对话框代码:
...
AlertDialog(
title: Text('Showing Lip'),
content: Container(
child: Image.asset(
'assets/tutorial/lip.gif',
height: 125.0,
width: 125.0,
),
),
...
感谢您的帮助 您正在使用正确的方法显示GIF 您的问题可能是您试图显示的文件的路径不正确 您是否在
pubspec.yaml
文件中添加了此文件?
下面是关于如何将资产添加到您的Flitter项目中的说明我刚刚发现了问题所在。。。我没有重建项目,但只是热加载。。。通过“颤振跑”进行全面重建后,一切正常。。。