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

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

Issue 1173293005: Make UINode's key a String (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: nit 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/sdk/lib/widgets/modal_overlay.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 bdb45f558cddf9eb0bb5aa524bece8e03af230f7..8cb13d30c54dbedc7edf61d24ccfb25f7bbd24ff 100644
--- a/sky/sdk/lib/widgets/popup_menu.dart
+++ b/sky/sdk/lib/widgets/popup_menu.dart
@@ -54,7 +54,7 @@ class PopupMenuController {
class PopupMenu extends AnimatedComponent {
- PopupMenu({ Object key, this.controller, this.items, this.level })
+ PopupMenu({ String key, this.controller, this.items, this.level })
: super(key: key) {
_painter = new BoxPainter(new BoxDecoration(
backgroundColor: Grey[50],
@@ -94,7 +94,10 @@ class PopupMenu extends AnimatedComponent {
int i = 0;
List<UINode> children = new List.from(items.map((List<UINode> item) {
double opacity = _opacityFor(i);
- return new PopupMenuItem(key: i++, children: item, opacity: opacity);
+ // TODO(abarth): Using |i| for the key here seems wrong.
+ return new PopupMenuItem(key: (i++).toString(),
+ children: item
+ opacity: opacity);
}));
return new Opacity(
« no previous file with comments | « sky/sdk/lib/widgets/modal_overlay.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