Automatically fill in the menu button when there's a drawer

Also, fill in a back arrow when we can go back.

Fixes #699
This commit is contained in:
Adam Barth
2015-12-03 16:18:12 -08:00
parent 5ad32f2987
commit e17c3eccf6
11 changed files with 56 additions and 53 deletions

View File

@@ -17,8 +17,6 @@ class GalleryPage extends StatefulComponent {
}
class _GalleryPageState extends State<GalleryPage> {
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
Widget _buildDrawer() {
List<Widget> items = <Widget>[
new DrawerHeader(child: new Text('Material demos')),
@@ -53,12 +51,7 @@ class _GalleryPageState extends State<GalleryPage> {
Widget build(BuildContext context) {
return new Scaffold(
key: _scaffoldKey,
toolBar: new ToolBar(
left: new IconButton(
icon: 'navigation/menu',
onPressed: () { _scaffoldKey.currentState?.openDrawer(); }
),
center: new Text(config.active?.title ?? 'Material gallery'),
tabBar: _buildTabBar()
),