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

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

Issue 1166153002: Add a basic popup menu implementation to stocks2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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/stocks2/lib/stock_menu.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/stocks2/lib/stock_app.dart
diff --git a/sky/examples/stocks2/lib/stock_app.dart b/sky/examples/stocks2/lib/stock_app.dart
index 5da26a17dfb70af82268b642dc2556c811eadfa8..fe4f8b49e13b1e5736186f6d4b9511f8873fb383 100644
--- a/sky/examples/stocks2/lib/stock_app.dart
+++ b/sky/examples/stocks2/lib/stock_app.dart
@@ -11,8 +11,8 @@ import 'package:sky/framework/components2/icon_button.dart';
import 'package:sky/framework/components2/menu_divider.dart';
import 'package:sky/framework/components2/menu_item.dart';
import 'package:sky/framework/components2/input.dart';
-// import 'package:sky/framework/components2/modal_overlay.dart';
-// import 'package:sky/framework/components2/popup_menu.dart';
+import 'package:sky/framework/components2/modal_overlay.dart';
+import 'package:sky/framework/components2/popup_menu.dart';
import 'package:sky/framework/components2/radio.dart';
import 'package:sky/framework/components2/scaffold.dart';
import 'package:sky/framework/fn2.dart';
@@ -21,7 +21,7 @@ import 'package:sky/framework/theme2/colors.dart' as colors;
import 'stock_data.dart';
import 'package:sky/framework/rendering/box.dart';
import 'stock_list.dart';
-// import 'stock_menu.dart';
+import 'stock_menu.dart';
import 'dart:async';
import 'dart:sky' as sky;
@@ -77,22 +77,22 @@ class StocksApp extends App {
});
}
- // PopupMenuController _menuController;
+ PopupMenuController _menuController;
void _handleMenuShow(_) {
setState(() {
- // _menuController = new PopupMenuController();
- // _menuController.open();
+ _menuController = new PopupMenuController();
+ _menuController.open();
});
}
void _handleMenuHide(_) {
setState(() {
- // _menuController.close().then((_) {
- // setState(() {
- // _menuController = null;
- // });
- // });
+ _menuController.close().then((_) {
+ setState(() {
+ _menuController = null;
+ });
+ });
});
}
@@ -187,15 +187,15 @@ class StocksApp extends App {
}
void addMenuToOverlays(List<UINode> overlays) {
- // if (_menuController == null)
- // return;
- // overlays.add(new ModalOverlay(
- // children: [new StockMenu(
- // controller: _menuController,
- // autorefresh: _autorefresh,
- // onAutorefreshChanged: _handleAutorefreshChanged
- // )],
- // onDismiss: _handleMenuHide));
+ if (_menuController == null)
+ return;
+ overlays.add(new ModalOverlay(
+ children: [new StockMenu(
+ controller: _menuController,
+ autorefresh: _autorefresh,
+ onAutorefreshChanged: _handleAutorefreshChanged
+ )],
+ onDismiss: _handleMenuHide));
}
UINode build() {
« no previous file with comments | « no previous file | sky/examples/stocks2/lib/stock_menu.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698