Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2. import 'package:ScrumBooster/utils/utils.dart';
  3. import 'dart:async';
  4.  
  5. class SplashScreen extends StatefulWidget {
  6. @override
  7. _SplashScreenState createState() => _SplashScreenState();
  8. }
  9.  
  10. class _SplashScreenState extends State<SplashScreen> {
  11. final util = new Util();
  12.  
  13. Future transitionToHome() {
  14. return new Future.delayed(
  15. const Duration(seconds: 2),
  16. () => Navigator.of(context).pushReplacementNamed('/Home'),
  17. );
  18. }
  19.  
  20. @override
  21. void initState() {
  22. super.initState();
  23. transitionToHome();
  24. }
  25.  
  26. @override
  27. Widget build(BuildContext context) {
  28. final _height = MediaQuery.of(context).size.height;
  29. final _width = MediaQuery.of(context).size.width;
  30.  
  31. return new Scaffold(
  32. resizeToAvoidBottomPadding: false,
  33. body: new Container(
  34. height: _height,
  35. width: _width,
  36. decoration: new BoxDecoration(
  37. color: util.hexToColor("#3498DB"),
  38. ),
  39. child: new Center(
  40. child: new Column(
  41. mainAxisAlignment: MainAxisAlignment.center,
  42. crossAxisAlignment: CrossAxisAlignment.center,
  43. children: <Widget>[
  44. new Image(
  45. image: new AssetImage('assets/logos/logo-white.png'),
  46. height: util.fitScreenSize(_height, 0.5),
  47. width: util.fitScreenSize(_width, 0.5),
  48. ),
  49. new Padding(
  50. padding: EdgeInsets.all(util.fitScreenSize(_height, 0.075)),
  51. ),
  52. new Text(
  53. "SCRUM BOOSTER",
  54. style: new TextStyle(
  55. fontWeight: FontWeight.bold,
  56. color: util.hexToColor("#FFFFFF"),
  57. fontSize: 25.0,
  58. ),
  59. ),
  60. ],
  61. ),
  62. ),
  63. ),
  64. );
  65. }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement