Last active
September 16, 2020 10:25
-
-
Save Blasanka/74923852d070c4a0c6eb07953ca9ddd5 to your computer and use it in GitHub Desktop.
Lear more in slcoderlk.blogspot.com This code demonstrate how to add background image to your flutter app. Also you have to add assets section and specify images in flutter section. https://gist.github.com/Blasanka/3dece37b5b28f5bbf099581ae4cbe8aa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(new QuoteApp()); | |
class QuoteApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( | |
title: 'Motivational Quote App', | |
home: new Scaffold( | |
body: new Stack( | |
children: <Widget>[ | |
new Container( | |
decoration: new BoxDecoration( | |
image: new DecorationImage( | |
image: new AssetImage('assets/images/bill-gates.jpg'), | |
fit: BoxFit.cover, | |
), | |
), | |
), | |
new Center( | |
child: new Text('Never give up'), | |
) | |
], | |
)), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment