| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 double drawStart = scrollOffset + alignmentDelta; | 56 double drawStart = scrollOffset + alignmentDelta; |
| 57 itemNumber = math.max(0, (drawStart / itemHeight).floor()); | 57 itemNumber = math.max(0, (drawStart / itemHeight).floor()); |
| 58 | 58 |
| 59 transform.translate(0.0, alignmentDelta); | 59 transform.translate(0.0, alignmentDelta); |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 | 62 |
| 63 return new SizeObserver( | 63 return new SizeObserver( |
| 64 callback: _handleSizeChanged, | 64 callback: _handleSizeChanged, |
| 65 child: new Clip( | 65 child: new Clip( |
| 66 child: new Transform( | 66 child: new DecoratedBox( |
| 67 transform: transform, | 67 decoration: const BoxDecoration( |
| 68 child: new BlockContainer( | 68 backgroundColor: const Color(0xFFFFFFFF) |
| 69 children: buildItems(itemNumber, itemCount)) | 69 ), |
| 70 child: new Transform( |
| 71 transform: transform, |
| 72 child: new BlockContainer( |
| 73 children: buildItems(itemNumber, itemCount)) |
| 74 ) |
| 70 ) | 75 ) |
| 71 ) | 76 ) |
| 72 ); | 77 ); |
| 73 } | 78 } |
| 74 | 79 |
| 75 List<UINode> buildItems(int start, int count); | 80 List<UINode> buildItems(int start, int count); |
| 76 } | 81 } |
| OLD | NEW |