Answers for "add background image to container flutter"

3

add bg image to scaffold flutter

@override
Widget build(BuildContext context) {
  return new Scaffold(
    body: new Stack(
      children: <Widget>[
        new Container(
          decoration: new BoxDecoration(
            image: new DecorationImage(image: new AssetImage("images/background.jpg"), fit: BoxFit.cover,),
          ),
        ),
        new Center(
          child: new Text("Hello background"),
        )
      ],
    )
  );
}
Posted by: Guest on December-29-2020
4

flutter background image

Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Welcome to Flutter',
      home: Container(
        decoration: BoxDecoration(
            image: DecorationImage(
                image: AssetImage("images/logo.png"), fit: BoxFit.cover)),
        child: Scaffold(),),);
Posted by: Guest on June-12-2021
1

add bg image flutter

//This should be inside Container widget
			decoration: BoxDecoration(
            image: DecorationImage(
                image: AssetImage('assets/image.jpeg'), fit: BoxFit.cover),
          ),
Posted by: Guest on September-20-2021

Code answers related to "add background image to container flutter"

Browse Popular Code Answers by Language