Created
July 12, 2017 21:41
-
-
Save collinjackson/9730df6080c1cdd374841d2e0636fb72 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'; | |
class LoginPage extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
void _profile() { | |
Navigator.popAndPushNamed(context, "/Profile"); | |
} | |
return new Scaffold( | |
floatingActionButton: new FloatingActionButton( | |
onPressed: _profile, | |
child: new Icon(Icons.navigate_next), | |
), | |
); | |
} | |
} | |
class Profile extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new Scaffold( | |
body: new Center( | |
child: new Text('You made it!'), | |
), | |
); | |
} | |
} | |
void main() { | |
runApp(new MaterialApp( | |
home: new LoginPage(), | |
routes: <String, WidgetBuilder> | |
{ | |
"/Profile": (BuildContext context) => new Profile(), | |
} | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment