| 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'; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 assert(scrollRect.height > 0); | 45 assert(scrollRect.height > 0); |
| 46 assert(itemRect.height > 0); | 46 assert(itemRect.height > 0); |
| 47 | 47 |
| 48 setState(() { | 48 setState(() { |
| 49 _height = scrollRect.height; | 49 _height = scrollRect.height; |
| 50 _itemHeight = itemRect.height; | 50 _itemHeight = itemRect.height; |
| 51 }); | 51 }); |
| 52 }); | 52 }); |
| 53 } | 53 } |
| 54 | 54 |
| 55 Node buildContent() { | 55 UINode buildContent() { |
| 56 var itemNumber = 0; | 56 var itemNumber = 0; |
| 57 var drawCount = 1; | 57 var drawCount = 1; |
| 58 var transformStyle = ''; | 58 var transformStyle = ''; |
| 59 | 59 |
| 60 if (_itemHeight == null) | 60 if (_itemHeight == null) |
| 61 new Future.microtask(_measureHeights); | 61 new Future.microtask(_measureHeights); |
| 62 | 62 |
| 63 if (_height > 0.0 && _itemHeight != null) { | 63 if (_height > 0.0 && _itemHeight != null) { |
| 64 if (scrollOffset < 0.0) { | 64 if (scrollOffset < 0.0) { |
| 65 double visibleHeight = _height + scrollOffset; | 65 double visibleHeight = _height + scrollOffset; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 86 children: [ | 86 children: [ |
| 87 new Container( | 87 new Container( |
| 88 style: _scrollAreaStyle, | 88 style: _scrollAreaStyle, |
| 89 inlineStyle: transformStyle, | 89 inlineStyle: transformStyle, |
| 90 children: buildItems(itemNumber, drawCount) | 90 children: buildItems(itemNumber, drawCount) |
| 91 ) | 91 ) |
| 92 ] | 92 ] |
| 93 ); | 93 ); |
| 94 } | 94 } |
| 95 } | 95 } |
| OLD | NEW |