Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. class FirstMain extends StatelessWidget {
  2. @override
  3. Widget build(BuildContext context) {
  4. return Scaffold(
  5. body:TabviewWidget(),
  6. drawer: Drawer(
  7.  
  8. child: ListView(
  9. children: <Widget>[
  10.  
  11. ListTile(
  12. title: Text('Item 2'),
  13. onTap: () {
  14. Navigator.push(
  15. context,
  16. MaterialPageRoute(builder: (context) => SecondRoute()),
  17. );
  18.  
  19. },
  20. ),
  21. ],
  22. ),
  23. ),
  24.  
  25. );
  26.  
  27. }
  28. }
  29.  
  30. class SecondRoute extends StatelessWidget {
  31. @override
  32. Widget build(BuildContext context) {
  33. return Scaffold(
  34. appBar: AppBar(
  35. title: Text("Second Route"),
  36. ),
  37. body: Center(
  38. child: RaisedButton(
  39. onPressed: () {
  40. Navigator.pop(context);
  41. },
  42. child: Text('Go back!'),
  43. ),
  44. ),
  45. );
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement