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

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

Issue 1190793002: Rename UINode to Widget. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 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/widgets/drawer_header.dart ('k') | sky/sdk/lib/widgets/floating_action_button.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 '../framework/animation/scroll_behavior.dart'; 9 import '../framework/animation/scroll_behavior.dart';
10 import 'basic.dart'; 10 import 'basic.dart';
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 38
39 double _height; 39 double _height;
40 void _handleSizeChanged(Size newSize) { 40 void _handleSizeChanged(Size newSize) {
41 setState(() { 41 setState(() {
42 _height = newSize.height; 42 _height = newSize.height;
43 scrollBehavior.containerHeight = _height; 43 scrollBehavior.containerHeight = _height;
44 }); 44 });
45 } 45 }
46 46
47 UINode buildContent() { 47 Widget buildContent() {
48 var itemShowIndex = 0; 48 var itemShowIndex = 0;
49 var itemShowCount = 0; 49 var itemShowCount = 0;
50 50
51 Matrix4 transform = new Matrix4.identity(); 51 Matrix4 transform = new Matrix4.identity();
52 52
53 if (_height != null && _height > 0.0) { 53 if (_height != null && _height > 0.0) {
54 if (scrollOffset < 0.0) { 54 if (scrollOffset < 0.0) {
55 double visibleHeight = _height + scrollOffset; 55 double visibleHeight = _height + scrollOffset;
56 itemShowCount = (visibleHeight / itemHeight).round() + 1; 56 itemShowCount = (visibleHeight / itemHeight).round() + 1;
57 transform.translate(0.0, -scrollOffset); 57 transform.translate(0.0, -scrollOffset);
(...skipping 14 matching lines...) Expand all
72 callback: _handleSizeChanged, 72 callback: _handleSizeChanged,
73 child: new ClipRect( 73 child: new ClipRect(
74 child: new Transform( 74 child: new Transform(
75 transform: transform, 75 transform: transform,
76 child: new Block(buildItems(itemShowIndex, itemShowCount)) 76 child: new Block(buildItems(itemShowIndex, itemShowCount))
77 ) 77 )
78 ) 78 )
79 ); 79 );
80 } 80 }
81 81
82 List<UINode> buildItems(int start, int count); 82 List<Widget> buildItems(int start, int count);
83 83
84 } 84 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/widgets/drawer_header.dart ('k') | sky/sdk/lib/widgets/floating_action_button.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698