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

Unified Diff: sky/sdk/example/stocks/lib/stock_home.dart

Issue 1234063003: Remove PopupMenuController (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase Created 5 years, 5 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/sdk/example/stocks/lib/stock_menu.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/example/stocks/lib/stock_home.dart
diff --git a/sky/sdk/example/stocks/lib/stock_home.dart b/sky/sdk/example/stocks/lib/stock_home.dart
index 9115736cc88276fb38a3578f90c6eae37d672579..a5436b9f30559ae8c9ac871525a6b7e7e9892978 100644
--- a/sky/sdk/example/stocks/lib/stock_home.dart
+++ b/sky/sdk/example/stocks/lib/stock_home.dart
@@ -100,22 +100,25 @@ class StockHome extends AnimatedComponent {
});
}
- PopupMenuController _menuController;
+ bool _menuShowing = false;
+ PopupMenuStatus _menuStatus = PopupMenuStatus.inactive;
void _handleMenuShow() {
setState(() {
- _menuController = new PopupMenuController();
- _menuController.open();
+ _menuShowing = true;
+ _menuStatus = PopupMenuStatus.active;
});
}
void _handleMenuHide() {
setState(() {
- _menuController.close().then((_) {
- setState(() {
- _menuController = null;
- });
- });
+ _menuShowing = false;
+ });
+ }
+
+ void _handleMenuStatusChanged(PopupMenuStatus status) {
+ setState(() {
+ _menuStatus = status;
});
}
@@ -303,11 +306,12 @@ class StockHome extends AnimatedComponent {
}
void addMenuToOverlays(List<Widget> overlays) {
- if (_menuController == null)
+ if (_menuStatus == PopupMenuStatus.inactive)
return;
overlays.add(new ModalOverlay(
children: [new StockMenu(
- controller: _menuController,
+ showing: _menuShowing,
+ onStatusChanged: _handleMenuStatusChanged,
autorefresh: _autorefresh,
onAutorefreshChanged: _handleAutorefreshChanged
)],
« no previous file with comments | « no previous file | sky/sdk/example/stocks/lib/stock_menu.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698