Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to display animated gif in flutter?

Tags:

I am trying to display gif in flutter.

I am using the code

Image(image : NetworkImage(message.image_url)) 

But it shows error:

Another exception was thrown: Exception: HTTP request failed, statusCode: 403, https://media.giphy.com/media/13AXYJh2jDt2IE/giphy.gif%20 
like image 878
Monu Kumar Avatar asked Jul 27 '18 10:07

Monu Kumar


2 Answers

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, ), 
like image 105
Pritish Avatar answered Sep 16 '22 16:09

Pritish


This is what used in Flutter Gallery app to display .gif from web

Image.network('https://example.com/animated-image.gif') 
like image 28
Daniil Yakovlev Avatar answered Sep 18 '22 16:09

Daniil Yakovlev