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

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

Issue 1216533003: Remove the pointless second argument to animate() in AnimatedValue. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 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/animated_component.dart ('k') | sky/sdk/lib/widgets/popup_menu.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/drawer.dart
diff --git a/sky/sdk/lib/widgets/drawer.dart b/sky/sdk/lib/widgets/drawer.dart
index ac84a95b04a4f92fec8fb9ce953c75dd2e355ea0..c2c0fb7bfcb769d32302c3d8ec7a943bfc47af4f 100644
--- a/sky/sdk/lib/widgets/drawer.dart
+++ b/sky/sdk/lib/widgets/drawer.dart
@@ -114,9 +114,7 @@ class Drawer extends AnimatedComponent {
this.children,
this.level: 0
}) : super(key: key) {
- animate(controller.position, (double value) {
- _position = value;
- });
+ watch(controller.position);
}
List<Widget> children;
@@ -130,13 +128,11 @@ class Drawer extends AnimatedComponent {
super.syncFields(source);
}
- double _position;
-
Widget build() {
Matrix4 transform = new Matrix4.identity();
- transform.translate(_position);
+ transform.translate(controller.position.value);
- double scaler = _position / _kWidth + 1;
+ double scaler = controller.position.value / _kWidth + 1;
Color maskColor = new Color.fromARGB((0x7F * scaler).floor(), 0, 0, 0);
var mask = new Listener(
« no previous file with comments | « sky/sdk/lib/widgets/animated_component.dart ('k') | sky/sdk/lib/widgets/popup_menu.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698