Question Detail

How to set Background image Widget flutter

6 years ago Views 10016 Visit Post Reply

I have import Image in My Flutter Project How to set Background Image on the Mobile Screen in the Flutter Framework.

Thread Reply


- 6 years ago

If you want the image to fill the entire screen you can use a DecorationImage with a fit of BoxFit.cover.

class MyApp extends StatelessWidget{
  Widget build(BuildContext context){
    return new Scaffold(
      body: new Container(
        decoration: new BoxDecoration(
          image: new DecorationImage(
            image: new AssetImage("assets/google.jpg"),
            fit: BoxFit.cover,
        child: null,


- 5 years ago

  child:Text("hello world",textDirection: TextDirection.ltr),
) );