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

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

Issue 1232403004: Trivial code style changes in animation code. (Closed) Base URL: https://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
Index: sky/sdk/lib/widgets/material.dart
diff --git a/sky/sdk/lib/widgets/material.dart b/sky/sdk/lib/widgets/material.dart
index cc7ebffb9afd690cd593a79cbb691f3b53a90616..107193b4ebea716719a6b1ee07adf09d34bc2df8 100644
--- a/sky/sdk/lib/widgets/material.dart
+++ b/sky/sdk/lib/widgets/material.dart
@@ -39,18 +39,22 @@ class Material extends AnimatedComponent {
int level;
Color color;
- AnimationBuilder _builder;
+ final AnimationBuilder _builder = new AnimationBuilder();
Matt Perry 2015/07/13 17:32:55 Wouldn't this cause us to allocate a new object fo
abarth-chromium 2015/07/13 17:41:06 Constructors for final fields are called lazily th
abarth-chromium 2015/07/13 17:44:59 s/Constructors/initializers/
void initState() {
- _builder = new AnimationBuilder()
+ _builder
..shadow = new AnimatedType<double>(level.toDouble())
..backgroundColor = _getBackgroundColor(type, color)
..borderRadius = edges[type]
..shape = type == MaterialType.circle ? Shape.circle : Shape.rectangle;
watchPerformance(_builder.createPerformance(
- [_builder.shadow], duration: _kAnimateShadowDuration));
+ [_builder.shadow],
+ duration: _kAnimateShadowDuration
+ ));
watchPerformance(_builder.createPerformance(
- [_builder.backgroundColor], duration: _kAnimateColorDuration));
+ [_builder.backgroundColor],
+ duration: _kAnimateColorDuration
+ ));
super.initState();
}
« sky/sdk/lib/widgets/animation_builder.dart ('K') | « sky/sdk/lib/widgets/animation_builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698