| 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 '../fn2.dart'; | 6 import '../fn2.dart'; |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:math' as math; | 8 import 'dart:math' as math; |
| 9 import 'package:vector_math/vector_math.dart'; | 9 import 'package:vector_math/vector_math.dart'; |
| 10 import 'scrollable.dart'; | 10 import 'scrollable.dart'; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 double drawStart = scrollOffset + alignmentDelta; | 62 double drawStart = scrollOffset + alignmentDelta; |
| 63 itemShowIndex = math.max(0, (drawStart / itemHeight).floor()); | 63 itemShowIndex = math.max(0, (drawStart / itemHeight).floor()); |
| 64 | 64 |
| 65 transform.translate(0.0, alignmentDelta); | 65 transform.translate(0.0, alignmentDelta); |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 | 68 |
| 69 return new SizeObserver( | 69 return new SizeObserver( |
| 70 callback: _handleSizeChanged, | 70 callback: _handleSizeChanged, |
| 71 child: new Clip( | 71 child: new ClipRect( |
| 72 child: new DecoratedBox( | 72 child: new DecoratedBox( |
| 73 decoration: const BoxDecoration( | 73 decoration: const BoxDecoration( |
| 74 backgroundColor: const Color(0xFFFFFFFF) | 74 backgroundColor: const Color(0xFFFFFFFF) |
| 75 ), | 75 ), |
| 76 child: new Transform( | 76 child: new Transform( |
| 77 transform: transform, | 77 transform: transform, |
| 78 child: new Block(buildItems(itemShowIndex, itemShowCount)) | 78 child: new Block(buildItems(itemShowIndex, itemShowCount)) |
| 79 ) | 79 ) |
| 80 ) | 80 ) |
| 81 ) | 81 ) |
| 82 ); | 82 ); |
| 83 } | 83 } |
| 84 | 84 |
| 85 List<UINode> buildItems(int start, int count); | 85 List<UINode> buildItems(int start, int count); |
| 86 | 86 |
| 87 } | 87 } |
| OLD | NEW |