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

Side by Side Diff: sky/framework/components/drawer.dart

Issue 1037673002: Disentangle Material and InkSplash (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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
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 'animated_component.dart'; 5 import 'animated_component.dart';
6 import '../animation/animated_value.dart'; 6 import '../animation/animated_value.dart';
7 import '../animation/curves.dart'; 7 import '../animation/curves.dart';
8 import '../fn.dart'; 8 import '../fn.dart';
9 import '../theme/colors.dart'; 9 import '../theme/colors.dart';
10 import '../theme/shadows.dart'; 10 import '../theme/shadows.dart';
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 119 }
120 120
121 Node build() { 121 Node build() {
122 bool isClosed = _position <= -_kWidth; 122 bool isClosed = _position <= -_kWidth;
123 String inlineStyle = 'display: ${isClosed ? 'none' : ''}'; 123 String inlineStyle = 'display: ${isClosed ? 'none' : ''}';
124 String maskInlineStyle = 'opacity: ${(_position / _kWidth + 1) * 0.5}'; 124 String maskInlineStyle = 'opacity: ${(_position / _kWidth + 1) * 0.5}';
125 String contentInlineStyle = 'transform: translateX(${_position}px)'; 125 String contentInlineStyle = 'transform: translateX(${_position}px)';
126 126
127 var mask = new EventTarget( 127 var mask = new EventTarget(
128 new Container( 128 new Container(
129 key: 'Mask',
130 style: _maskStyle, 129 style: _maskStyle,
131 inlineStyle: maskInlineStyle 130 inlineStyle: maskInlineStyle
132 ), 131 ),
133 onGestureTap: controller.handleMaskTap, 132 onGestureTap: controller.handleMaskTap,
134 onGestureFlingStart: controller.handleFlingStart 133 onGestureFlingStart: controller.handleFlingStart
135 ); 134 );
136 135
137 Node content = new StyleNode( 136 Material content = new Material(
138 new Material( 137 content: new Container(
139 key: 'Content', 138 style: _contentStyle,
140 inlineStyle: contentInlineStyle, 139 inlineStyle: contentInlineStyle,
141 children: children, 140 children: children
142 level: level), 141 ),
143 _contentStyle); 142 level: level);
144 143
145 return new EventTarget( 144 return new EventTarget(
146 new Container( 145 new Container(
147 style: _style, 146 style: _style,
148 inlineStyle: inlineStyle, 147 inlineStyle: inlineStyle,
149 children: [ mask, content ] 148 children: [ mask, content ]
150 ), 149 ),
151 onPointerDown: controller.handlePointerDown, 150 onPointerDown: controller.handlePointerDown,
152 onPointerMove: controller.handlePointerMove, 151 onPointerMove: controller.handlePointerMove,
153 onPointerUp: controller.handlePointerUp, 152 onPointerUp: controller.handlePointerUp,
154 onPointerCancel: controller.handlePointerCancel 153 onPointerCancel: controller.handlePointerCancel
155 ); 154 );
156 } 155 }
157 } 156 }
OLDNEW
« no previous file with comments | « sky/framework/components/button.dart ('k') | sky/framework/components/floating_action_button.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698