| 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/shadows.dart'; | 9 import '../theme/shadows.dart'; |
| 10 import 'animated_component.dart'; | 10 import 'animated_component.dart'; |
| 11 import 'animation_builder.dart'; | 11 import 'animation_builder.dart'; |
| 12 import 'basic.dart'; | 12 import 'basic.dart'; |
| 13 import 'scrollable_viewport.dart'; |
| 13 import 'theme.dart'; | 14 import 'theme.dart'; |
| 14 | 15 |
| 15 // TODO(eseidel): Draw width should vary based on device size: | 16 // TODO(eseidel): Draw width should vary based on device size: |
| 16 // http://www.google.com/design/spec/layout/structure.html#structure-side-nav | 17 // http://www.google.com/design/spec/layout/structure.html#structure-side-nav |
| 17 | 18 |
| 18 // Mobile: | 19 // Mobile: |
| 19 // Width = Screen width − 56 dp | 20 // Width = Screen width − 56 dp |
| 20 // Maximum width: 320dp | 21 // Maximum width: 320dp |
| 21 // Maximum width applies only when using a left nav. When using a right nav, | 22 // Maximum width applies only when using a left nav. When using a right nav, |
| 22 // the panel can cover the full width of the screen. | 23 // the panel can cover the full width of the screen. |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 child: new Container(decoration: new BoxDecoration(backgroundColor: maskCo
lor)), | 132 child: new Container(decoration: new BoxDecoration(backgroundColor: maskCo
lor)), |
| 132 onGestureTap: controller.handleMaskTap | 133 onGestureTap: controller.handleMaskTap |
| 133 ); | 134 ); |
| 134 | 135 |
| 135 Widget content = controller.builder.build( | 136 Widget content = controller.builder.build( |
| 136 new Container( | 137 new Container( |
| 137 decoration: new BoxDecoration( | 138 decoration: new BoxDecoration( |
| 138 backgroundColor: Theme.of(this).canvasColor, | 139 backgroundColor: Theme.of(this).canvasColor, |
| 139 boxShadow: shadows[level]), | 140 boxShadow: shadows[level]), |
| 140 width: _kWidth, | 141 width: _kWidth, |
| 141 child: new Block(children) | 142 child: new ScrollableBlock(children) |
| 142 )); | 143 )); |
| 143 | 144 |
| 144 return new Listener( | 145 return new Listener( |
| 145 child: new Stack([ mask, content ]), | 146 child: new Stack([ mask, content ]), |
| 146 onPointerDown: controller.handlePointerDown, | 147 onPointerDown: controller.handlePointerDown, |
| 147 onPointerMove: controller.handlePointerMove, | 148 onPointerMove: controller.handlePointerMove, |
| 148 onPointerUp: controller.handlePointerUp, | 149 onPointerUp: controller.handlePointerUp, |
| 149 onPointerCancel: controller.handlePointerCancel, | 150 onPointerCancel: controller.handlePointerCancel, |
| 150 onGestureFlingStart: controller.handleFlingStart | 151 onGestureFlingStart: controller.handleFlingStart |
| 151 ); | 152 ); |
| 152 } | 153 } |
| 153 | 154 |
| 154 } | 155 } |
| OLD | NEW |