Created
September 3, 2019 17:41
-
-
Save Nash0x7E2/999e3ccf1d42c2b61e39d7864a3d771e to your computer and use it in GitHub Desktop.
This file contains hidden or 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/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