how set a background image in container in flutter code example
Example 1: background color to container flutter
new Container(
width: 100,
height: 30,
decoration: new BoxDecoration(
color: Colors.green
),
)
Example 2: 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(
backgroundColor: Colors.transparent,
appBar: AppBar(
elevation: 0,
backgroundColor: Colors.transparent,
title: Text('My App'),
centerTitle: true,
leading: IconButton(
icon: Icon(
Icons.list,
color: Colors.white,
),
onPressed: () {}),
),
),
),
);
}