| 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 'basic.dart'; | 10 import 'basic.dart'; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 super.syncFields(source); | 31 super.syncFields(source); |
| 32 } | 32 } |
| 33 | 33 |
| 34 ScrollBehavior createScrollBehavior() => new OverscrollBehavior(); | 34 ScrollBehavior createScrollBehavior() => new OverscrollBehavior(); |
| 35 OverscrollBehavior get scrollBehavior => super.scrollBehavior; | 35 OverscrollBehavior get scrollBehavior => super.scrollBehavior; |
| 36 | 36 |
| 37 double _height; | 37 double _height; |
| 38 void _handleSizeChanged(Size newSize) { | 38 void _handleSizeChanged(Size newSize) { |
| 39 setState(() { | 39 setState(() { |
| 40 _height = newSize.height; | 40 _height = newSize.height; |
| 41 scrollBehavior.containerHeight = _height; | 41 scrollBehavior.containerSize = _height; |
| 42 }); | 42 }); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void _updateContentsHeight() { | 45 void _updateContentsHeight() { |
| 46 double contentsHeight = itemHeight * itemCount; | 46 double contentsHeight = itemHeight * itemCount; |
| 47 if (padding != null) | 47 if (padding != null) |
| 48 contentsHeight += padding.top + padding.bottom; | 48 contentsHeight += padding.top + padding.bottom; |
| 49 scrollBehavior.contentsHeight = contentsHeight; | 49 scrollBehavior.contentsSize = contentsHeight; |
| 50 } | 50 } |
| 51 | 51 |
| 52 void _updateScrollOffset() { | 52 void _updateScrollOffset() { |
| 53 if (scrollOffset > scrollBehavior.maxScrollOffset) | 53 if (scrollOffset > scrollBehavior.maxScrollOffset) |
| 54 settleScrollOffset(); | 54 settleScrollOffset(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 Widget buildContent() { | 57 Widget buildContent() { |
| 58 if (itemCount != _previousItemCount) { | 58 if (itemCount != _previousItemCount) { |
| 59 _previousItemCount = itemCount; | 59 _previousItemCount = itemCount; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 child: new Block(items) | 96 child: new Block(items) |
| 97 ) | 97 ) |
| 98 ) | 98 ) |
| 99 ) | 99 ) |
| 100 ); | 100 ); |
| 101 } | 101 } |
| 102 | 102 |
| 103 List<Widget> buildItems(int start, int count); | 103 List<Widget> buildItems(int start, int count); |
| 104 | 104 |
| 105 } | 105 } |
| OLD | NEW |