Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.