OLD | NEW |
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 '../animation/animation_performance.dart'; | 7 import '../animation/animation_performance.dart'; |
8 import '../animation/curves.dart'; | 8 import '../animation/curves.dart'; |
9 import '../theme/colors.dart'; | |
10 import '../theme/shadows.dart'; | 9 import '../theme/shadows.dart'; |
11 import 'animated_component.dart'; | 10 import 'animated_component.dart'; |
12 import 'basic.dart'; | 11 import 'basic.dart'; |
| 12 import 'theme.dart'; |
13 | 13 |
14 // TODO(eseidel): Draw width should vary based on device size: | 14 // TODO(eseidel): Draw width should vary based on device size: |
15 // http://www.google.com/design/spec/layout/structure.html#structure-side-nav | 15 // http://www.google.com/design/spec/layout/structure.html#structure-side-nav |
16 | 16 |
17 // Mobile: | 17 // Mobile: |
18 // Width = Screen width − 56 dp | 18 // Width = Screen width − 56 dp |
19 // Maximum width: 320dp | 19 // Maximum width: 320dp |
20 // Maximum width applies only when using a left nav. When using a right nav, | 20 // Maximum width applies only when using a left nav. When using a right nav, |
21 // the panel can cover the full width of the screen. | 21 // the panel can cover the full width of the screen. |
22 | 22 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 Color maskColor = new Color.fromARGB((0x7F * scaler).floor(), 0, 0, 0); | 121 Color maskColor = new Color.fromARGB((0x7F * scaler).floor(), 0, 0, 0); |
122 | 122 |
123 var mask = new Listener( | 123 var mask = new Listener( |
124 child: new Container(decoration: new BoxDecoration(backgroundColor: maskCo
lor)), | 124 child: new Container(decoration: new BoxDecoration(backgroundColor: maskCo
lor)), |
125 onGestureTap: controller.handleMaskTap | 125 onGestureTap: controller.handleMaskTap |
126 ); | 126 ); |
127 | 127 |
128 Widget content = controller.position.build( | 128 Widget content = controller.position.build( |
129 new Container( | 129 new Container( |
130 decoration: new BoxDecoration( | 130 decoration: new BoxDecoration( |
131 backgroundColor: Grey[50], | 131 backgroundColor: Theme.of(this).canvasColor, |
132 boxShadow: shadows[level]), | 132 boxShadow: shadows[level]), |
133 width: _kWidth, | 133 width: _kWidth, |
134 child: new Block(children) | 134 child: new Block(children) |
135 )); | 135 )); |
136 | 136 |
137 return new Listener( | 137 return new Listener( |
138 child: new Stack([ mask, content ]), | 138 child: new Stack([ mask, content ]), |
139 onPointerDown: controller.handlePointerDown, | 139 onPointerDown: controller.handlePointerDown, |
140 onPointerMove: controller.handlePointerMove, | 140 onPointerMove: controller.handlePointerMove, |
141 onPointerUp: controller.handlePointerUp, | 141 onPointerUp: controller.handlePointerUp, |
142 onPointerCancel: controller.handlePointerCancel, | 142 onPointerCancel: controller.handlePointerCancel, |
143 onGestureFlingStart: controller.handleFlingStart | 143 onGestureFlingStart: controller.handleFlingStart |
144 ); | 144 ); |
145 } | 145 } |
146 | 146 |
147 } | 147 } |
OLD | NEW |