如何在扑动中显示动画gif? [英] how to display animated gif in flutter?

查看:81
本文介绍了如何在扑动中显示动画gif?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图在颤抖中显示gif.

I am trying to display gif in flutter.

我正在使用代码

Image(image : NetworkImage(message.image_url))

但显示错误:

Another exception was thrown: Exception: HTTP request failed, statusCode: 403, https://media.giphy.com/media/13AXYJh2jDt2IE/giphy.gif%20

推荐答案

gif放置在项目的图像文件夹中,并在pubspec.yaml文件中提及它,就像处理图像一样.

Place your gif in your images folder of your project and mention it in pubspec.yaml file,just like you do for images.

Image.asset(
                    "images/loading.gif",
                    height: 125.0,
                    width: 125.0,
                  )

这篇关于如何在扑动中显示动画gif?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆