Skip to content

Instantly share code, notes, and snippets.

@collinjackson
Created July 12, 2017 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save collinjackson/9730df6080c1cdd374841d2e0636fb72 to your computer and use it in GitHub Desktop.
Save collinjackson/9730df6080c1cdd374841d2e0636fb72 to your computer and use it in GitHub Desktop.
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