Commit d268da7a authored by Hixie's avatar Hixie

Plug the drawer into stock2.

Not tested on device.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1160523005
parent 7f705336
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'package:sky/framework/components2/tool_bar.dart'; import 'package:sky/framework/components2/tool_bar.dart';
// import 'package:sky/framework/components2/drawer.dart'; import 'package:sky/framework/components2/drawer.dart';
// import 'package:sky/framework/components2/drawer_header.dart'; // import 'package:sky/framework/components2/drawer_header.dart';
// import 'package:sky/framework/components2/floating_action_button.dart'; // import 'package:sky/framework/components2/floating_action_button.dart';
// import 'package:sky/framework/components2/icon.dart'; // import 'package:sky/framework/components2/icon.dart';
...@@ -46,7 +46,7 @@ class StocksApp extends App { ...@@ -46,7 +46,7 @@ class StocksApp extends App {
data.appendTo(_stocks); data.appendTo(_stocks);
}); });
}); });
// _drawerController = new DrawerController(_handleDrawerStatusChanged); _drawerController = new DrawerController(_handleDrawerStatusChanged);
} }
bool _isSearching = false; bool _isSearching = false;
...@@ -71,7 +71,7 @@ class StocksApp extends App { ...@@ -71,7 +71,7 @@ class StocksApp extends App {
}); });
} }
// DrawerController _drawerController; DrawerController _drawerController;
bool _drawerShowing = false; bool _drawerShowing = false;
void _handleDrawerStatusChanged(bool showing) { void _handleDrawerStatusChanged(bool showing) {
...@@ -115,10 +115,11 @@ class StocksApp extends App { ...@@ -115,10 +115,11 @@ class StocksApp extends App {
// static FlexBoxParentData _flex1 = new FlexBoxParentData()..flex = 1; // static FlexBoxParentData _flex1 = new FlexBoxParentData()..flex = 1;
// Drawer buildDrawer() { Drawer buildDrawer() {
// return new Drawer( return new Drawer(
// controller: _drawerController, controller: _drawerController,
// level: 3, level: 3
// ,
// children: [ // children: [
// new DrawerHeader(children: [new Text('Stocks')]), // new DrawerHeader(children: [new Text('Stocks')]),
// new MenuItem( // new MenuItem(
...@@ -155,15 +156,15 @@ class StocksApp extends App { ...@@ -155,15 +156,15 @@ class StocksApp extends App {
// key: 'Help & Feedback', // key: 'Help & Feedback',
// icon: 'action/help', // icon: 'action/help',
// children: [new Text('Help & Feedback')]) // children: [new Text('Help & Feedback')])
// ] // ]
// ); );
// } }
UINode buildToolBar() { UINode buildToolBar() {
return new ToolBar( return new ToolBar(
left: new IconButton( left: new IconButton(
icon: 'navigation/menu_white', icon: 'navigation/menu_white',
onGestureTap: (_) => true), // _drawerController.toggle), onGestureTap: (_) => _drawerController.toggle),
center: new Text('Stocks'), center: new Text('Stocks'),
right: [ right: [
new IconButton( new IconButton(
...@@ -206,13 +207,12 @@ class StocksApp extends App { ...@@ -206,13 +207,12 @@ class StocksApp extends App {
UINode build() { UINode build() {
List<UINode> overlays = [ List<UINode> overlays = [
new Scaffold( new Scaffold(
toolbar: _isSearching ? buildSearchBar() : buildToolBar() toolbar: _isSearching ? buildSearchBar() : buildToolBar(),
// ,
// body: new Stocklist(stocks: _stocks, query: _searchQuery), // body: new Stocklist(stocks: _stocks, query: _searchQuery),
// floatingActionButton: new FloatingActionButton( // floatingActionButton: new FloatingActionButton(
// content: new Icon(type: 'content/add_white', size: 24), // content: new Icon(type: 'content/add_white', size: 24),
// level: 3), // level: 3),
// drawer: _drawerShowing ? buildDrawer() : null drawer: _drawerShowing ? buildDrawer() : null
), ),
]; ];
addMenuToOverlays(overlays); addMenuToOverlays(overlays);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment