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

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

Issue 1126333006: [Effen] Make the drawer not be included in the build output when the drawer is not shown. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: git cl land Created 5 years, 7 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/animation/animated_value.dart ('k') | sky/framework/components/drawer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/components/animated_component.dart
diff --git a/sky/framework/components/animated_component.dart b/sky/framework/components/animated_component.dart
index a4bfda004fe0bb19774c61b7f63a48a19e3b6c0d..34d906f2a0edf4a97e4511a6c422f946ff5e67bc 100644
--- a/sky/framework/components/animated_component.dart
+++ b/sky/framework/components/animated_component.dart
@@ -9,12 +9,18 @@ import 'dart:mirrors';
abstract class AnimatedComponent extends Component {
AnimatedComponent({ Object key }) : super(key: key, stateful: true);
+ var _debugAnimatedFields = new Set<Symbol>();
+ bool _debugIsNotYetAnimated(Symbol s) {
+ return _debugAnimatedFields.add(s);
+ }
+
animateField(AnimatedValue value, Symbol symbol) {
// TODO(rafaelw): Assert symbol is present on |this|, is private and
// is over the same parameterized type as the animated value.
var mirror = reflect(this);
var subscription;
+ assert(_debugIsNotYetAnimated(symbol));
mirror.setField(symbol, value.value);
onDidMount(() {
« no previous file with comments | « sky/framework/animation/animated_value.dart ('k') | sky/framework/components/drawer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698