Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 颤振:在警报对话框中显示资产gif_Flutter_Dialog_Gif - Fatal编程技术网

Flutter 颤振:在警报对话框中显示资产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(

我试图在警报对话框中显示此gif资源,但出现错误:

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项目中的说明

我刚刚发现了问题所在。。。我没有重建项目,但只是热加载。。。通过“颤振跑”进行全面重建后,一切正常。。。