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
This commit is contained in:
Matt Perry 2016-06-08 17:04:40 -04:00
parent fcd68c8a21
commit 479c7da9f1

View File

@ -168,7 +168,17 @@ class _PestoDemoState extends State<PestoDemo> {
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
});
}
),
]
)
);