Answers for "add a background image to the scaffold 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

Code answers related to "add a background image to the scaffold flutter"

Browse Popular Code Answers by Language