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

Side by Side Diff: sky/sdk/lib/widgets/drawer.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 unified diff | Download patch
« no previous file with comments | « sky/sdk/lib/widgets/dismissable.dart ('k') | sky/sdk/lib/widgets/material.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'dart:sky' as sky; 5 import 'dart:sky' as sky;
6 6
7 import 'package:sky/animation/animation_performance.dart'; 7 import 'package:sky/animation/animation_performance.dart';
8 import 'package:sky/animation/curves.dart'; 8 import 'package:sky/animation/curves.dart';
9 import 'package:sky/theme/shadows.dart'; 9 import 'package:sky/theme/shadows.dart';
10 import 'package:sky/widgets/animated_component.dart'; 10 import 'package:sky/widgets/animated_component.dart';
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 performance.fling(velocity: velocityX / _kWidth); 98 performance.fling(velocity: velocityX / _kWidth);
99 } 99 }
100 } 100 }
101 101
102 class Drawer extends AnimatedComponent { 102 class Drawer extends AnimatedComponent {
103 Drawer({ 103 Drawer({
104 String key, 104 String key,
105 this.controller, 105 this.controller,
106 this.children, 106 this.children,
107 this.level: 0 107 this.level: 0
108 }) : super(key: key) { 108 }) : super(key: key);
109 watchPerformance(controller.performance);
110 }
111 109
112 List<Widget> children; 110 List<Widget> children;
113 int level; 111 int level;
114 DrawerController controller; 112 DrawerController controller;
115 113
114 void initState() {
115 watch(controller.performance);
116 }
117
116 void syncFields(Drawer source) { 118 void syncFields(Drawer source) {
117 children = source.children; 119 children = source.children;
118 level = source.level; 120 level = source.level;
119 controller = source.controller; 121 controller = source.controller;
120 super.syncFields(source); 122 super.syncFields(source);
121 } 123 }
122 124
123 // TODO(mpcomplete): the animation system should handle building, maybe? Or 125 // TODO(mpcomplete): the animation system should handle building, maybe? Or
124 // at least setting the transform. Figure out how this could work for things 126 // at least setting the transform. Figure out how this could work for things
125 // like fades, slides, rotates, pinch, etc. 127 // like fades, slides, rotates, pinch, etc.
(...skipping 20 matching lines...) Expand all
146 child: new Stack([ mask, content ]), 148 child: new Stack([ mask, content ]),
147 onPointerDown: controller.handlePointerDown, 149 onPointerDown: controller.handlePointerDown,
148 onPointerMove: controller.handlePointerMove, 150 onPointerMove: controller.handlePointerMove,
149 onPointerUp: controller.handlePointerUp, 151 onPointerUp: controller.handlePointerUp,
150 onPointerCancel: controller.handlePointerCancel, 152 onPointerCancel: controller.handlePointerCancel,
151 onGestureFlingStart: controller.handleFlingStart 153 onGestureFlingStart: controller.handleFlingStart
152 ); 154 );
153 } 155 }
154 156
155 } 157 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/widgets/dismissable.dart ('k') | sky/sdk/lib/widgets/material.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698