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

Unified Diff: sky/framework/components/popup_menu_item.dart

Issue 1016093002: Begin work on the PopupMenu entrance animation (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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/framework/components/popup_menu.dart ('k') | sky/framework/fn.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
);
}
« no previous file with comments | « sky/framework/components/popup_menu.dart ('k') | sky/framework/fn.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698