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

Unified Diff: sky/sdk/lib/widgets/popup_menu.dart

Issue 1187463013: Make PopupMenuItem take a single child instead of an implicitly-flex list of children. (Closed) Base URL: https://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 | « sky/examples/stocks2/lib/stock_menu.dart ('k') | sky/sdk/lib/widgets/popup_menu_item.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/popup_menu.dart
diff --git a/sky/sdk/lib/widgets/popup_menu.dart b/sky/sdk/lib/widgets/popup_menu.dart
index 8cb13d30c54dbedc7edf61d24ccfb25f7bbd24ff..27a22bc7988cac9513f553c62abe24de3305294b 100644
--- a/sky/sdk/lib/widgets/popup_menu.dart
+++ b/sky/sdk/lib/widgets/popup_menu.dart
@@ -67,7 +67,7 @@ class PopupMenu extends AnimatedComponent {
}
PopupMenuController controller;
- List<List<UINode>> items;
+ List<UINode> items;
int level;
void syncFields(PopupMenu source) {
@@ -92,11 +92,10 @@ class PopupMenu extends AnimatedComponent {
UINode build() {
int i = 0;
- List<UINode> children = new List.from(items.map((List<UINode> item) {
+ List<UINode> children = new List.from(items.map((UINode item) {
double opacity = _opacityFor(i);
- // TODO(abarth): Using |i| for the key here seems wrong.
- return new PopupMenuItem(key: (i++).toString(),
- children: item
+ return new PopupMenuItem(key: '${key}-${item.key}',
+ child: item,
opacity: opacity);
}));
« no previous file with comments | « sky/examples/stocks2/lib/stock_menu.dart ('k') | sky/sdk/lib/widgets/popup_menu_item.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698