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

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

Issue 1008003007: Add a menu to the stocks app (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Tweak padding Created 5 years, 9 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/examples/stocks-fn/lib/stock_menu.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/stocks-fn/lib/stock_app.dart
diff --git a/sky/examples/stocks-fn/lib/stock_app.dart b/sky/examples/stocks-fn/lib/stock_app.dart
index 6ea4841b268af65a44d1f1d9bef8f5dc8cca0dbe..8e0a5cb462945fa60358f60da2e1eb04fdbfd356 100644
--- a/sky/examples/stocks-fn/lib/stock_app.dart
+++ b/sky/examples/stocks-fn/lib/stock_app.dart
@@ -14,6 +14,7 @@ import 'package:sky/framework/fn.dart';
import 'package:sky/framework/theme/typography.dart' as typography;
import 'stock_data.dart';
import 'stock_list.dart';
+import 'stock_menu.dart';
class StocksApp extends App {
@@ -39,6 +40,7 @@ class StocksApp extends App {
List<Stock> _sortedStocks;
bool _isSearching = false;
+ bool _isShowingMenu = false;
String _searchQuery;
StocksApp() : super() {
@@ -52,6 +54,13 @@ class StocksApp extends App {
});
}
+ void _handleMenuClick(_) {
+ print("_handleMenuClick");
ojan 2015/03/18 02:09:39 Did you mean to leave this in?
abarth-chromium 2015/03/18 02:19:58 Nope!
+ setState(() {
+ _isShowingMenu = !_isShowingMenu;
+ });
+ }
+
void _handleSearchQueryChanged(query) {
setState(() {
_searchQuery = query;
@@ -116,6 +125,7 @@ class StocksApp extends App {
new Icon(key: 'more_white', style: _iconStyle,
size: 24,
type: 'navigation/more_vert_white')
+ ..events.listen('gesturetap', _handleMenuClick),
]
);
@@ -124,17 +134,19 @@ class StocksApp extends App {
var fab = new FloatingActionButton(content: new Icon(
type: 'content/add_white', size: 24), level: 3);
- return new Container(
- key: 'StocksApp',
- children: [
- new Container(
- key: 'Content',
- style: _style,
- children: [toolbar, list]
- ),
- fab,
- drawer,
- ]
- );
+ var children = [
+ new Container(
+ key: 'Content',
+ style: _style,
+ children: [toolbar, list]
+ ),
+ fab,
+ drawer
+ ];
+
+ if (_isShowingMenu)
+ children.add(new StockMenu());
+
+ return new Container(key: 'StocksApp', children: children);
}
}
« no previous file with comments | « no previous file | sky/examples/stocks-fn/lib/stock_menu.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698