Created
March 1, 2018 14:43
-
-
Save anilcancakir/8f786a61db5811c55dbb12c45e46153c to your computer and use it in GitHub Desktop.
SplashPage class for my routing story.
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'; | |
| // Splash page... | |
| class SplashPage extends StatefulWidget { | |
| @override | |
| State<StatefulWidget> createState() { | |
| return new _SplashPageState(); | |
| } | |
| } | |
| class _SplashPageState extends State<SplashPage> { | |
| @override | |
| Widget build(BuildContext context) { | |
| return new Scaffold( | |
| appBar: new AppBar( | |
| title: new Text('Welcome to App!') | |
| ), | |
| body: new ListView( | |
| children: <Widget>[ | |
| new RaisedButton( | |
| onPressed: () { | |
| // Replace user page to "home" page. | |
| Navigator.pushReplacementNamed(context, 'home'); | |
| }, | |
| child: new Text('Let\'s start!') | |
| ), | |
| new FlatButton( | |
| onPressed: () { | |
| // Redirect to user "about" page. | |
| Navigator.pushNamed(context, 'about'); | |
| }, | |
| child: new Text('About') | |
| ) | |
| ], | |
| ) | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment