| 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'; | |
| 13 | 12 |
| 14 abstract class FixedHeightScrollable extends Scrollable { | 13 abstract class FixedHeightScrollable extends Scrollable { |
| 15 static final Style _style = new Style(''' | 14 static final Style _style = new Style(''' |
| 16 overflow: hidden; | 15 overflow: hidden; |
| 17 position: relative; | 16 position: relative; |
| 18 will-change: transform;''' | 17 will-change: transform;''' |
| 19 ); | 18 ); |
| 20 | 19 |
| 21 static final Style _scrollAreaStyle = new Style(''' | 20 static final Style _scrollAreaStyle = new Style(''' |
| 22 position:relative; | 21 position:relative; |
| 23 will-change: transform;''' | 22 will-change: transform;''' |
| 24 ); | 23 ); |
| 25 | 24 |
| 26 FixedHeightScrollable({ | 25 FixedHeightScrollable({ |
| 27 Object key | 26 Object key |
| 28 }) : super(key: key); | 27 }) : super(key: key); |
| 29 | 28 |
| 30 ScrollBehavior createScrollBehavior() => new OverscrollBehavior(); | 29 ScrollBehavior createScrollBehavior() => new OverscrollBehavior(); |
| 30 OverscrollBehavior get scrollBehavior => super.scrollBehavior as OverscrollBeh
avior; |
| 31 | 31 |
| 32 double _height = 0.0; | 32 double _height = 0.0; |
| 33 double _itemHeight; | 33 double _itemHeight; |
| 34 | 34 |
| 35 int _itemCount = 0; | 35 int _itemCount = 0; |
| 36 int get itemCount => _itemCount; | 36 int get itemCount => _itemCount; |
| 37 void set itemCount (int value) { | 37 void set itemCount (int value) { |
| 38 if (_itemCount != value) { | 38 if (_itemCount != value) { |
| 39 _itemCount = value; | 39 _itemCount = value; |
| 40 if (_itemHeight != null) | 40 if (_itemHeight != null) |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 style: _style, | 99 style: _style, |
| 100 children: [ | 100 children: [ |
| 101 new Container( | 101 new Container( |
| 102 style: _scrollAreaStyle, | 102 style: _scrollAreaStyle, |
| 103 inlineStyle: transformStyle, | 103 inlineStyle: transformStyle, |
| 104 children: buildItems(itemNumber, drawCount) | 104 children: buildItems(itemNumber, drawCount) |
| 105 ) | 105 ) |
| 106 ] | 106 ] |
| 107 ); | 107 ); |
| 108 } | 108 } |
| 109 |
| 110 List<UINode> buildItems(int start, int count); |
| 109 } | 111 } |
| OLD | NEW |