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

Unified Diff: sky/sdk/example/demo_launcher/lib/main.dart

Issue 1223083002: Make RenderBlock painting match its hittesting (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sky/sdk/lib/rendering/block.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/example/demo_launcher/lib/main.dart
diff --git a/sky/sdk/example/demo_launcher/lib/main.dart b/sky/sdk/example/demo_launcher/lib/main.dart
index 75c0f46fe1fcd28e88fe0bac9a7134644f9aca6d..0ad0bb18163bf439ccfb7369995ab037ff67685c 100644
--- a/sky/sdk/example/demo_launcher/lib/main.dart
+++ b/sky/sdk/example/demo_launcher/lib/main.dart
@@ -19,6 +19,7 @@ import 'package:sky/widgets/scaffold.dart';
import 'package:sky/widgets/task_description.dart';
import 'package:sky/widgets/theme.dart';
import 'package:sky/widgets/tool_bar.dart';
+import 'package:sky/widgets/scrollable_list.dart';
AssetBundle _initBundle() {
if (rootBundle != null)
@@ -132,11 +133,7 @@ List<Widget> demos = [
const double kCardHeight = 120.0;
const EdgeDims kListPadding = const EdgeDims.all(4.0);
-class DemoList extends FixedHeightScrollable {
- DemoList({ String key }) : super(key: key, itemHeight: kCardHeight, padding: kListPadding);
-
- int get itemCount => demos.length;
-
+class DemoList extends Component {
Widget buildDemo(SkyDemo demo) {
return new Listener(
key: demo.name,
@@ -166,12 +163,13 @@ class DemoList extends FixedHeightScrollable {
);
}
- List<Widget> buildItems(int start, int count) {
- return demos
- .skip(start)
- .take(count)
- .map(buildDemo)
- .toList(growable: false);
+ Widget build() {
+ return new ScrollableList<SkyDemo>(
+ items: demos,
+ itemHeight: kCardHeight,
+ itemBuilder: buildDemo,
+ padding: kListPadding
+ );
}
}
« no previous file with comments | « no previous file | sky/sdk/lib/rendering/block.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698