Index: sky/framework/components/popup_menu_item.dart |
diff --git a/sky/framework/components/popup_menu_item.dart b/sky/framework/components/popup_menu_item.dart |
index d404bf79e028cdbbcde545ba92b230040e493abd..8a5a7181bd23cb6662f37f79814d6b6e8bf360b0 100644 |
--- a/sky/framework/components/popup_menu_item.dart |
+++ b/sky/framework/components/popup_menu_item.dart |
@@ -2,6 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+import '../animation/animated_value.dart'; |
import '../fn.dart'; |
import 'material.dart'; |
@@ -11,12 +12,22 @@ class PopupMenuItem extends Component { |
padding: 16px;'''); |
List<Node> children; |
+ AnimatedValueListener _opacity; |
- PopupMenuItem({ Object key, this.children }) : super(key: key); |
+ PopupMenuItem({ Object key, this.children, AnimatedValue opacity}) : super(key: key) { |
+ _opacity = new AnimatedValueListener(this, opacity); |
+ } |
+ |
+ void didUnmount() { |
+ _opacity.stopListening(); |
+ } |
Node build() { |
+ _opacity.ensureListening(); |
+ |
return new Material( |
style: _style, |
+ inlineStyle: _opacity.value == null ? null : 'opacity: ${_opacity.value}', |
children: children |
); |
} |