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

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

Issue 1189833004: More minor cleanup around overriding fields to narrow types. (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/rendering/box.dart ('k') | no next file » | 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';
11 import 'scrollable.dart'; 11 import 'scrollable.dart';
12 12
13 abstract class FixedHeightScrollable extends Scrollable { 13 abstract class FixedHeightScrollable extends Scrollable {
14 14
15 FixedHeightScrollable({ String key, this.itemHeight, Color backgroundColor }) 15 FixedHeightScrollable({ String key, this.itemHeight, Color backgroundColor })
16 : super(key: key, backgroundColor: backgroundColor) { 16 : super(key: key, backgroundColor: backgroundColor) {
17 assert(itemHeight != null); 17 assert(itemHeight != null);
18 } 18 }
19 19
20 double itemHeight; 20 double itemHeight;
21 21
22 void syncFields(FixedHeightScrollable source) { 22 void syncFields(FixedHeightScrollable source) {
23 itemHeight = source.itemHeight; 23 itemHeight = source.itemHeight;
24 super.syncFields(source); 24 super.syncFields(source);
25 } 25 }
26 26
27 ScrollBehavior createScrollBehavior() => new OverscrollBehavior(); 27 ScrollBehavior createScrollBehavior() => new OverscrollBehavior();
28 OverscrollBehavior get scrollBehavior => super.scrollBehavior as OverscrollBeh avior; 28 OverscrollBehavior get scrollBehavior => super.scrollBehavior;
29 29
30 int _itemCount = 0; 30 int _itemCount = 0;
31 int get itemCount => _itemCount; 31 int get itemCount => _itemCount;
32 void set itemCount (int value) { 32 void set itemCount (int value) {
33 if (_itemCount != value) { 33 if (_itemCount != value) {
34 _itemCount = value; 34 _itemCount = value;
35 scrollBehavior.contentsHeight = itemHeight * _itemCount; 35 scrollBehavior.contentsHeight = itemHeight * _itemCount;
36 } 36 }
37 } 37 }
38 38
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
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<UINode> buildItems(int start, int count);
83 83
84 } 84 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/rendering/box.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698