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:
parent
fcd68c8a21
commit
479c7da9f1
@ -168,7 +168,17 @@ class _PestoDemoState extends State<PestoDemo> {
|
|||||||
child: new Text('Favorites'),
|
child: new Text('Favorites'),
|
||||||
selected: config.showFavorites,
|
selected: config.showFavorites,
|
||||||
onPressed: () { _showFavorites(context); }
|
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
|
||||||
|
});
|
||||||
|
}
|
||||||
|
),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user