Skip to content

Instantly share code, notes, and snippets.

@vijayinyoutube
Created September 5, 2022 08:12
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 vijayinyoutube/5eb55a3469cc5274567fb54d9cae6bc7 to your computer and use it in GitHub Desktop.
Save vijayinyoutube/5eb55a3469cc5274567fb54d9cae6bc7 to your computer and use it in GitHub Desktop.
Simple home page file containing navigation btns for first and second page
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
child: const Text('First page'),
onPressed: () => Navigator.pushNamed(context, '/firstpage')),
ElevatedButton(
child: const Text('Second page'),
onPressed: () => Navigator.pushNamed(context, '/secondpage')),
],
)),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment