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

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

Issue 1231103005: Rename watchPerformance to watch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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/scrollable.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/toggleable.dart
diff --git a/sky/sdk/lib/widgets/toggleable.dart b/sky/sdk/lib/widgets/toggleable.dart
index 5d5a945e2d7e9552972569fa111e210c97f472e9..dd06917ae5595a0bc4b488d1c1281270d84c5ab1 100644
--- a/sky/sdk/lib/widgets/toggleable.dart
+++ b/sky/sdk/lib/widgets/toggleable.dart
@@ -19,14 +19,7 @@ abstract class Toggleable extends AnimatedComponent {
String key,
this.value,
this.onChanged
- }) : super(key: key) {
- _position = new AnimatedType<double>(0.0, end: 1.0);
- _performance = new AnimationPerformance()
- ..variable = position
- ..duration = _kCheckDuration
- ..progress = value ? 1.0 : 0.0;
- watchPerformance(performance);
- }
+ }) : super(key: key);
bool value;
ValueChanged onChanged;
@@ -37,6 +30,15 @@ abstract class Toggleable extends AnimatedComponent {
AnimationPerformance _performance;
AnimationPerformance get performance => _performance;
+ void initState() {
+ _position = new AnimatedType<double>(0.0, end: 1.0);
+ _performance = new AnimationPerformance()
+ ..variable = position
+ ..duration = _kCheckDuration
+ ..progress = value ? 1.0 : 0.0;
+ watch(performance);
+ }
+
void syncFields(Toggleable source) {
onChanged = source.onChanged;
if (value != source.value) {
« no previous file with comments | « sky/sdk/lib/widgets/scrollable.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698