0
@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'),
      ),
    );
  }
esentis
  • 4,190
  • 2
  • 12
  • 28
Tortu
  • 29
  • 3

1 Answers1

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"))),
                      ),