Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Side by Side Diff: sky/sdk/lib/widgets/fixed_height_scrollable.dart

Issue 1226133004: Switch scroll physics over to using newton (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: analyzer nit Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/sdk/lib/animation/scroll_behavior.dart ('k') | sky/sdk/lib/widgets/scrollable.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/animation/scroll_behavior.dart ('k') | sky/sdk/lib/widgets/scrollable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698