Skip to content

Instantly share code, notes, and snippets.

@mohamad-supangat
Forked from xxGus/container-bg-image.dart
Created October 20, 2020 02:17
Show Gist options
  • Save mohamad-supangat/674d14c1434f77ebdf46589abc416add to your computer and use it in GitHub Desktop.
Save mohamad-supangat/674d14c1434f77ebdf46589abc416add to your computer and use it in GitHub Desktop.
Flutter Container background image
class BaseLayout extends StatelessWidget{
@override
Widget build(BuildContext context){
return Scaffold(
body: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/bulb.jpg"),
fit: BoxFit.cover,
),
),
child: null /* add child content here */,
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment