Skip to content

Instantly share code, notes, and snippets.

@anilcancakir
Created March 1, 2018 14:43
Show Gist options
  • Select an option

  • Save anilcancakir/8f786a61db5811c55dbb12c45e46153c to your computer and use it in GitHub Desktop.

Select an option

Save anilcancakir/8f786a61db5811c55dbb12c45e46153c to your computer and use it in GitHub Desktop.
SplashPage class for my routing story.
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