@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.only(right: 130, left: 130),
color: Colors.white,
child: const Image(
image: AssetImage('assets/img/loader.gif'),
),
);
}
Asked
Active
Viewed 475 times
0
-
1Does this answer your question? [how to display animated gif in flutter?](https://stackoverflow.com/questions/51556356/how-to-display-animated-gif-in-flutter) – Nitish Dec 10 '21 at 12:19
-
Any error occurs? – Jeel Bhatti Dec 10 '21 at 12:20
1 Answers
0
use this way if you need to set it as the wallpaper of a view
Container(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.cover,
image: AssetImage("assets/images/gif.gif"))),
),

Elvis Salabarria Aquino
- 588
- 2
- 7