Commit 15617976 authored by Hixie's avatar Hixie

[Effen] Make the drawer not be included in the build output when the drawer is not shown.

This is a prerequisite to dropping 'display:none'.
Included in this CL is making AnimatedValue able to animate more than one field.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1126333006
parent 769cef59
...@@ -27,8 +27,6 @@ import 'package:sky/framework/layout.dart'; ...@@ -27,8 +27,6 @@ import 'package:sky/framework/layout.dart';
const bool debug = false; // set to true to dump the DOM for debugging purposes const bool debug = false; // set to true to dump the DOM for debugging purposes
class StocksApp extends App { class StocksApp extends App {
DrawerController _drawerController = new DrawerController();
PopupMenuController _menuController;
static final Style _actionBarStyle = new Style(''' static final Style _actionBarStyle = new Style('''
background-color: ${Purple[500]};'''); background-color: ${Purple[500]};''');
...@@ -40,8 +38,6 @@ class StocksApp extends App { ...@@ -40,8 +38,6 @@ class StocksApp extends App {
${typography.white.title};'''); ${typography.white.title};''');
List<Stock> _stocks = []; List<Stock> _stocks = [];
bool _isSearching = false;
String _searchQuery;
StocksApp() : super() { StocksApp() : super() {
if (debug) if (debug)
...@@ -51,8 +47,12 @@ class StocksApp extends App { ...@@ -51,8 +47,12 @@ class StocksApp extends App {
data.appendTo(_stocks); data.appendTo(_stocks);
}); });
}); });
_drawerController = new DrawerController(_handleDrawerStatusChanged);
} }
bool _isSearching = false;
String _searchQuery;
void _handleSearchBegin(_) { void _handleSearchBegin(_) {
setState(() { setState(() {
_isSearching = true; _isSearching = true;
...@@ -72,6 +72,17 @@ class StocksApp extends App { ...@@ -72,6 +72,17 @@ class StocksApp extends App {
}); });
} }
DrawerController _drawerController;
bool _drawerShowing = false;
void _handleDrawerStatusChanged(bool showing) {
setState(() {
_drawerShowing = showing;
});
}
PopupMenuController _menuController;
void _handleMenuShow(_) { void _handleMenuShow(_) {
setState(() { setState(() {
_menuController = new PopupMenuController(); _menuController = new PopupMenuController();
...@@ -167,7 +178,7 @@ class StocksApp extends App { ...@@ -167,7 +178,7 @@ class StocksApp extends App {
content: new Stocklist(stocks: _stocks, query: _searchQuery), content: new Stocklist(stocks: _stocks, query: _searchQuery),
fab: new FloatingActionButton( fab: new FloatingActionButton(
content: new Icon(type: 'content/add_white', size: 24), level: 3), content: new Icon(type: 'content/add_white', size: 24), level: 3),
drawer: buildDrawer(), drawer: _drawerShowing ? buildDrawer() : null,
overlays: overlays overlays: 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