Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: sky/examples/stocks/lib/stock_app.dart

Issue 1126333006: [Effen] Make the drawer not be included in the build output when the drawer is not shown. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: git cl land Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sky/framework/animation/animated_value.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/stocks/lib/stock_app.dart
diff --git a/sky/examples/stocks/lib/stock_app.dart b/sky/examples/stocks/lib/stock_app.dart
index aa35a5dd4a7e8c2e370a326a1c0fce743545995f..2c63f6a073e6ccb94fe2462108ee9a2d5f2f36fa 100644
--- a/sky/examples/stocks/lib/stock_app.dart
+++ b/sky/examples/stocks/lib/stock_app.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
class StocksApp extends App {
- DrawerController _drawerController = new DrawerController();
- PopupMenuController _menuController;
static final Style _actionBarStyle = new Style('''
background-color: ${Purple[500]};''');
@@ -40,8 +38,6 @@ class StocksApp extends App {
${typography.white.title};''');
List<Stock> _stocks = [];
- bool _isSearching = false;
- String _searchQuery;
StocksApp() : super() {
if (debug)
@@ -51,8 +47,12 @@ class StocksApp extends App {
data.appendTo(_stocks);
});
});
+ _drawerController = new DrawerController(_handleDrawerStatusChanged);
}
+ bool _isSearching = false;
+ String _searchQuery;
+
void _handleSearchBegin(_) {
setState(() {
_isSearching = true;
@@ -72,6 +72,17 @@ class StocksApp extends App {
});
}
+ DrawerController _drawerController;
+ bool _drawerShowing = false;
+
+ void _handleDrawerStatusChanged(bool showing) {
+ setState(() {
+ _drawerShowing = showing;
+ });
+ }
+
+ PopupMenuController _menuController;
+
void _handleMenuShow(_) {
setState(() {
_menuController = new PopupMenuController();
@@ -167,7 +178,7 @@ class StocksApp extends App {
content: new Stocklist(stocks: _stocks, query: _searchQuery),
fab: new FloatingActionButton(
content: new Icon(type: 'content/add_white', size: 24), level: 3),
- drawer: buildDrawer(),
+ drawer: _drawerShowing ? buildDrawer() : null,
overlays: overlays
);
}
« no previous file with comments | « no previous file | sky/framework/animation/animated_value.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698