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

Unified Diff: sky/sdk/lib/framework/components2/menu_item.dart

Issue 1174023003: Remove one more use of mirrors: Components now have to explicitly sync their fields. (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
Index: sky/sdk/lib/framework/components2/menu_item.dart
diff --git a/sky/sdk/lib/framework/components2/menu_item.dart b/sky/sdk/lib/framework/components2/menu_item.dart
index b2f85ce38d1a80cde278018822c8e19fc76675c1..f2806f9bb69624684570643799fe984990c7c9ea 100644
--- a/sky/sdk/lib/framework/components2/menu_item.dart
+++ b/sky/sdk/lib/framework/components2/menu_item.dart
@@ -12,7 +12,7 @@ const BoxDecoration _kHighlightDecoration = const BoxDecoration(
);
// TODO(abarth): We shouldn't need _kHighlightBoring, but currently Container
-// isn't smarth enough to retain the components it builds when we
+// isn't smart enough to retain the components it builds when we
// add or remove a |decoration|. For now, we use a transparent
// decoration to avoid changing the structure of the tree. The
// right fix, however, is to make Container smarter about how it
@@ -24,10 +24,17 @@ const BoxDecoration _kHighlightBoring = const BoxDecoration(
class MenuItem extends ButtonBase {
MenuItem({ Object key, this.icon, this.children, this.onGestureTap }) : super(key: key);
- List<UINode> children;
String icon;
+ List<UINode> children;
GestureEventListener onGestureTap;
+ void syncFields(MenuItem source) {
+ icon = source.icon;
+ children = source.children;
+ onGestureTap = source.onGestureTap;
+ super.syncFields(source);
+ }
+
UINode buildContent() {
return new EventListenerNode(
new Container(
« no previous file with comments | « sky/sdk/lib/framework/components2/material.dart ('k') | sky/sdk/lib/framework/components2/modal_overlay.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698