Skip to content

Instantly share code, notes, and snippets.

@Nash0x7E2
Created September 3, 2019 17:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nash0x7E2/999e3ccf1d42c2b61e39d7864a3d771e to your computer and use it in GitHub Desktop.
Save Nash0x7E2/999e3ccf1d42c2b61e39d7864a3d771e to your computer and use it in GitHub Desktop.
import 'package:flutter/cupertino.dart' show CupertinoPageRoute;
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
home: HomePage(),
),
);
}
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: Center(
child: InkWell(
onTap: () => Navigator.of(context).push(PageTwo.route()),
child: Text('Clicky Here for page 2'),
),
),
),
);
}
}
class PageTwo extends StatelessWidget {
static Route<dynamic> route() {
return CupertinoPageRoute(
builder: (BuildContext context) {
return PageTwo();
},
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: Center(
child: Text('Page Two'),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment