Skip to content

Instantly share code, notes, and snippets.

@stephaniefash
Last active August 16, 2020 12:34
Show Gist options
  • Save stephaniefash/f9ea5f51bd03c04db9e752af72f63656 to your computer and use it in GitHub Desktop.
Save stephaniefash/f9ea5f51bd03c04db9e752af72f63656 to your computer and use it in GitHub Desktop.
class _MyHomePageState extends State<MyHomePage> {
String jungleImage =
"https://images.unsplash.com/photo-1588842785101-e6179be70d49?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format";
@override
void initState() {
SystemChrome.setEnabledSystemUIOverlays([]);
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black,
body: Stack(
children: [
Image.network(. // <- our jungle background
jungleImage,
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
fit: BoxFit.cover,
),
Positioned( // <- Our Jungle text
top: 260,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'JUNGLE',
style: TextStyle(
color: Colors.white,
fontSize: 80,
fontFamily: 'Vogue',
letterSpacing: 3),
),
)),
Positioned( // <- Our sub text
top: 310,
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Text(
'Stories from the jungle',
style: TextStyle(
color: Colors.white,
fontSize: 20,
fontFamily: 'Roboto'),
),
)),
Positioned( // <- the giraffe image
top: 50,
left: 40,
child: Image.asset(
'images/giraffe.png',
fit: BoxFit.fill,
),
),
Positioned( // <- the elephant image
bottom: 0,
child: Image.asset(
'images/elephant.png',
width: MediaQuery.of(context).size.width,
fit: BoxFit.fitWidth,
),
)
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment