Question Detail

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


Thread Reply

Anonymous

- 7 months 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{
  @override
  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,
      ),
    );
  }
}