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