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

Side by Side Diff: sky/examples/fn/widgets/drawer.dart

Issue 992033002: Change the name of Component.render to Component.build in Effen (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: README Created 5 years, 9 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/examples/fn/widgets/checkbox.dart ('k') | sky/examples/fn/widgets/drawerheader.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 part of widgets; 1 part of widgets;
2 2
3 const double _kWidth = 256.0; 3 const double _kWidth = 256.0;
4 const double _kMinFlingVelocity = 0.4; 4 const double _kMinFlingVelocity = 0.4;
5 const double _kBaseSettleDurationMS = 246.0; 5 const double _kBaseSettleDurationMS = 246.0;
6 const double _kMaxSettleDurationMS = 600.0; 6 const double _kMaxSettleDurationMS = 600.0;
7 const Cubic _kAnimationCurve = easeOut; 7 const Cubic _kAnimationCurve = easeOut;
8 8
9 class DrawerAnimation { 9 class DrawerAnimation {
10 10
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 return; 145 return;
146 146
147 _listening = true; 147 _listening = true;
148 animation.onPositionChanged.listen((position) { 148 animation.onPositionChanged.listen((position) {
149 setState(() { 149 setState(() {
150 _position = position; 150 _position = position;
151 }); 151 });
152 }); 152 });
153 } 153 }
154 154
155 Node render() { 155 Node build() {
156 _ensureListening(); 156 _ensureListening();
157 157
158 bool isClosed = _position <= -_kWidth; 158 bool isClosed = _position <= -_kWidth;
159 String inlineStyle = 'display: ${isClosed ? 'none' : ''}'; 159 String inlineStyle = 'display: ${isClosed ? 'none' : ''}';
160 String maskInlineStyle = 'opacity: ${(_position / _kWidth + 1) * 0.25}'; 160 String maskInlineStyle = 'opacity: ${(_position / _kWidth + 1) * 0.25}';
161 String contentInlineStyle = 'transform: translateX(${_position}px)'; 161 String contentInlineStyle = 'transform: translateX(${_position}px)';
162 162
163 Container mask = new Container( 163 Container mask = new Container(
164 key: 'Mask', 164 key: 'Mask',
165 style: _maskStyle, 165 style: _maskStyle,
(...skipping 12 matching lines...) Expand all
178 style: _style, 178 style: _style,
179 inlineStyle: inlineStyle, 179 inlineStyle: inlineStyle,
180 children: [ mask, content ] 180 children: [ mask, content ]
181 )..events.listen('pointerdown', animation.handlePointerDown) 181 )..events.listen('pointerdown', animation.handlePointerDown)
182 ..events.listen('pointermove', animation.handlePointerMove) 182 ..events.listen('pointermove', animation.handlePointerMove)
183 ..events.listen('pointerup', animation.handlePointerUp) 183 ..events.listen('pointerup', animation.handlePointerUp)
184 ..events.listen('pointercancel', animation.handlePointerCancel); 184 ..events.listen('pointercancel', animation.handlePointerCancel);
185 185
186 } 186 }
187 } 187 }
OLDNEW
« no previous file with comments | « sky/examples/fn/widgets/checkbox.dart ('k') | sky/examples/fn/widgets/drawerheader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698