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 '../fn.dart'; | 6 import '../fn.dart'; |
7 import 'dart:math' as math; | 7 import 'dart:math' as math; |
8 import 'dart:sky' as sky; | 8 import 'dart:sky' as sky; |
9 import 'scrollable.dart'; | 9 import 'scrollable.dart'; |
10 | 10 |
11 abstract class FixedHeightScrollable extends Scrollable { | 11 abstract class FixedHeightScrollable extends Scrollable { |
12 // TODO(rafaelw): This component really shouldn't have an opinion | |
13 // about how it is sized. The owning component should decide whether | |
14 // it's explicitly sized or flexible or whatever... | |
15 static final Style _style = new Style(''' | 12 static final Style _style = new Style(''' |
16 overflow: hidden; | 13 overflow: hidden; |
17 position: relative; | 14 position: relative; |
18 flex: 1; | |
19 will-change: transform;''' | 15 will-change: transform;''' |
20 ); | 16 ); |
21 | 17 |
22 static final Style _scrollAreaStyle = new Style(''' | 18 static final Style _scrollAreaStyle = new Style(''' |
23 position:relative; | 19 position:relative; |
24 will-change: transform;''' | 20 will-change: transform;''' |
25 ); | 21 ); |
26 | 22 |
27 double _height = 0.0; | 23 double _height = 0.0; |
28 double _itemHeight; | 24 double _itemHeight; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 children: [ | 75 children: [ |
80 new Container( | 76 new Container( |
81 style: _scrollAreaStyle, | 77 style: _scrollAreaStyle, |
82 inlineStyle: transformStyle, | 78 inlineStyle: transformStyle, |
83 children: buildItems(itemNumber, drawCount) | 79 children: buildItems(itemNumber, drawCount) |
84 ) | 80 ) |
85 ] | 81 ] |
86 ); | 82 ); |
87 } | 83 } |
88 } | 84 } |
OLD | NEW |