Created
March 19, 2019 04:55
-
-
Save izznfkhrlislm/a4661c93f379b4f78d3a12836f875670 to your computer and use it in GitHub Desktop.
This file contains 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'; | |
import 'package:ScrumBooster/utils/utils.dart'; | |
import 'dart:async'; | |
class SplashScreen extends StatefulWidget { | |
@override | |
_SplashScreenState createState() => _SplashScreenState(); | |
} | |
class _SplashScreenState extends State<SplashScreen> { | |
final util = new Util(); | |
Future transitionToHome() { | |
return new Future.delayed( | |
const Duration(seconds: 2), | |
() => Navigator.of(context).pushReplacementNamed('/Home'), | |
); | |
} | |
@override | |
void initState() { | |
super.initState(); | |
transitionToHome(); | |
} | |
@override | |
Widget build(BuildContext context) { | |
final _height = MediaQuery.of(context).size.height; | |
final _width = MediaQuery.of(context).size.width; | |
return new Scaffold( | |
resizeToAvoidBottomPadding: false, | |
body: new Container( | |
height: _height, | |
width: _width, | |
decoration: new BoxDecoration( | |
color: util.hexToColor("#3498DB"), | |
), | |
child: new Center( | |
child: new Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
crossAxisAlignment: CrossAxisAlignment.center, | |
children: <Widget>[ | |
new Image( | |
image: new AssetImage('assets/logos/logo-white.png'), | |
height: util.fitScreenSize(_height, 0.5), | |
width: util.fitScreenSize(_width, 0.5), | |
), | |
new Padding( | |
padding: EdgeInsets.all(util.fitScreenSize(_height, 0.075)), | |
), | |
new Text( | |
"SCRUM BOOSTER", | |
style: new TextStyle( | |
fontWeight: FontWeight.bold, | |
color: util.hexToColor("#FFFFFF"), | |
fontSize: 25.0, | |
), | |
), | |
], | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment