| 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 '../animation/scroll_behavior.dart'; | 5 import '../animation/scroll_behavior.dart'; |
| 6 import '../debug/tracing.dart'; | 6 import '../debug/tracing.dart'; |
| 7 import '../fn.dart'; | 7 import '../fn.dart'; |
| 8 import 'dart:math' as math; | 8 import 'dart:math' as math; |
| 9 import 'dart:sky' as sky; | 9 import 'dart:sky' as sky; |
| 10 import 'dart:async'; | 10 import 'dart:async'; |
| 11 import 'scrollable.dart'; | 11 import 'scrollable.dart'; |
| 12 import '../layouts/block.dart'; |
| 12 | 13 |
| 13 abstract class FixedHeightScrollable extends Scrollable { | 14 abstract class FixedHeightScrollable extends Scrollable { |
| 14 static final Style _style = new Style(''' | 15 static final Style _style = new Style(''' |
| 15 overflow: hidden; | 16 overflow: hidden; |
| 16 position: relative; | 17 position: relative; |
| 17 will-change: transform;''' | 18 will-change: transform;''' |
| 18 ); | 19 ); |
| 19 | 20 |
| 20 static final Style _scrollAreaStyle = new Style(''' | 21 static final Style _scrollAreaStyle = new Style(''' |
| 21 position:relative; | 22 position:relative; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 itemNumber = math.max(0, (drawStart / _itemHeight).floor()); | 78 itemNumber = math.max(0, (drawStart / _itemHeight).floor()); |
| 78 | 79 |
| 79 transformStyle = | 80 transformStyle = |
| 80 'transform: translateY(${(alignmentDelta).toStringAsFixed(2)}px)'; | 81 'transform: translateY(${(alignmentDelta).toStringAsFixed(2)}px)'; |
| 81 } | 82 } |
| 82 } | 83 } |
| 83 | 84 |
| 84 return new Container( | 85 return new Container( |
| 85 style: _style, | 86 style: _style, |
| 86 children: [ | 87 children: [ |
| 87 new Container( | 88 new BlockLayout( |
| 88 style: _scrollAreaStyle, | 89 style: _scrollAreaStyle, |
| 89 inlineStyle: transformStyle, | 90 inlineStyle: transformStyle, |
| 90 children: buildItems(itemNumber, drawCount) | 91 children: buildItems(itemNumber, drawCount) |
| 91 ) | 92 ) |
| 92 ] | 93 ] |
| 93 ); | 94 ); |
| 94 } | 95 } |
| 95 } | 96 } |
| OLD | NEW |