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

Side by Side Diff: sky/sdk/example/demo_launcher/lib/main.dart

Issue 1219933004: Make it harder to forget itemCount for FixedHeightScrollable (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: address ian's comments 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 | « no previous file | sky/sdk/example/stocks/lib/stock_home.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:sky'; 5 import 'dart:sky';
6 6
7 import 'package:mojom/intents/intents.mojom.dart'; 7 import 'package:mojom/intents/intents.mojom.dart';
8 import 'package:sky/mojo/asset_bundle.dart'; 8 import 'package:sky/mojo/asset_bundle.dart';
9 import 'package:sky/mojo/shell.dart' as shell; 9 import 'package:sky/mojo/shell.dart' as shell;
10 import 'package:sky/painting/box_painter.dart'; 10 import 'package:sky/painting/box_painter.dart';
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 ), 122 ),
123 123
124 // TODO(jackson): This doesn't seem to be working 124 // TODO(jackson): This doesn't seem to be working
125 // new SkyDemo('Licenses', 'LICENSES.sky'), 125 // new SkyDemo('Licenses', 'LICENSES.sky'),
126 ]; 126 ];
127 127
128 const double kCardHeight = 120.0; 128 const double kCardHeight = 120.0;
129 const EdgeDims kListPadding = const EdgeDims.all(4.0); 129 const EdgeDims kListPadding = const EdgeDims.all(4.0);
130 130
131 class DemoList extends FixedHeightScrollable { 131 class DemoList extends FixedHeightScrollable {
132 DemoList({ String key }) : super(key: key, itemHeight: kCardHeight, padding: k ListPadding) { 132 DemoList({ String key }) : super(key: key, itemHeight: kCardHeight, padding: k ListPadding);
133 itemCount = demos.length; 133
134 } 134 int get itemCount => demos.length;
135 135
136 Widget buildDemo(SkyDemo demo) { 136 Widget buildDemo(SkyDemo demo) {
137 return new Listener( 137 return new Listener(
138 key: demo.name, 138 key: demo.name,
139 onGestureTap: (_) => launch(demo.href, demo.bundle), 139 onGestureTap: (_) => launch(demo.href, demo.bundle),
140 child: new Container( 140 child: new Container(
141 height: kCardHeight, 141 height: kCardHeight,
142 child: new Card( 142 child: new Card(
143 child: new Flex([ 143 child: new Flex([
144 new Flexible( 144 new Flexible(
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 child: new DemoList() 185 child: new DemoList()
186 ) 186 )
187 ) 187 )
188 ); 188 );
189 } 189 }
190 } 190 }
191 191
192 void main() { 192 void main() {
193 runApp(new SkyHome()); 193 runApp(new SkyHome());
194 } 194 }
OLDNEW
« no previous file with comments | « no previous file | sky/sdk/example/stocks/lib/stock_home.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698