Skip to content

Instantly share code, notes, and snippets.

@pologonzalo
Created September 9, 2018 07:56
Show Gist options
  • Save pologonzalo/c32252dc9d6e504c8dc22e3ec8bd6685 to your computer and use it in GitHub Desktop.
Save pologonzalo/c32252dc9d6e504c8dc22e3ec8bd6685 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
/* ====================================================== */
/* Widgets */
/* ====================================================== */
import 'package:travel_pal/screens/splash/widgets/splash_button_widget.dart';
/* ====================================================== */
/* Implementation */
/* ====================================================== */
class Splash extends StatelessWidget {
Widget _buildBackground() {
return new Image.asset(
'images/background-splash.png',
fit: BoxFit.fitHeight,
height: double.infinity,
);
}
Widget _buildHeader() {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 80.0, horizontal: 24.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Text(
'Explore',
style: TextStyle(fontSize: 24.0, fontWeight: FontWeight.w600),
),
SizedBox(
height: 5.0,
),
Text(
'new amazing countries',
style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.w100),
)
],
),
);
}
Widget _buildButtons() {
return Padding(
padding: const EdgeInsets.only(bottom: 40.0),
child: new Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
FlatButton(
onPressed: () {},
child: Text(
'Log In',
style: TextStyle(color: Colors.white),
),
),
FlatButton(
onPressed: () {},
child: Text(
'Sign Up',
style: TextStyle(color: Colors.white),
),
),
],
),
);
}
@override
Widget build(BuildContext context) {
return new Scaffold(
body: new Stack(children: <Widget>[
_buildBackground(),
new Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[_buildHeader(), _buildButtons()],
)
]),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment