From 479c7da9f10d97648542cce142b8d1b7aa24dfe5 Mon Sep 17 00:00:00 2001 From: Matt Perry Date: Wed, 8 Jun 2016 17:04:40 -0400 Subject: [PATCH] Add a 'Return to Gallery' drawer option to Pesto. (#4472) * Add a 'Return to Gallery' drawer option to Pesto. BUG=https://github.com/flutter/flutter/issues/4402 * oops --- examples/flutter_gallery/lib/demo/pesto_demo.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/examples/flutter_gallery/lib/demo/pesto_demo.dart b/examples/flutter_gallery/lib/demo/pesto_demo.dart index aedbe54d31..493b4ba117 100644 --- a/examples/flutter_gallery/lib/demo/pesto_demo.dart +++ b/examples/flutter_gallery/lib/demo/pesto_demo.dart @@ -168,7 +168,17 @@ class _PestoDemoState extends State { child: new Text('Favorites'), selected: config.showFavorites, onPressed: () { _showFavorites(context); } - ) + ), + new Divider(), + new DrawerItem( + child: new Text('Return to Gallery'), + onPressed: () { + Navigator.openTransaction(context, (NavigatorTransaction transaction) { + transaction.pop(); // Close the Drawer + transaction.pop(); // Go back to the gallery + }); + } + ), ] ) );