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

Side by Side Diff: sky/examples/fn2/container.dart

Issue 1177243002: Refactor fn2.dart, since it breached our 1000-line threshold. (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 | « mojo/public/dart/lib/application.dart ('k') | sky/examples/fn2/hello_fn2.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 import 'dart:sky' as sky;
6 import 'package:sky/framework/fn2.dart';
7 import 'package:sky/framework/rendering/box.dart';
8 import '../lib/solid_color_box.dart';
9
10 class Rectangle extends RenderObjectWrapper {
11 RenderSolidColorBox root;
12 RenderSolidColorBox createNode() =>
13 new RenderSolidColorBox(color, desiredSize: new sky.Size(40.0, 130.0));
14
15 final int color;
16
17 Rectangle(this.color, { Object key }) : super(key: key);
18 }
19
20 class ContainerApp extends App {
21 UINode build() {
22 return new EventListenerNode(
23 new Block([
24 new Container(
25 padding: new EdgeDims.all(10.0),
26 margin: new EdgeDims.all(10.0),
27 height: 100.0,
28 decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFF00F F00)),
29 child: new Block([
30 new Container(
31 decoration: new BoxDecoration(backgroundColor: const sky.Color(0xF FFFFF00)),
32 height: 20.0,
33 ),
34 new Image(src: "https://www.dartlang.org/logos/dart-logo.png",
35 size: new sky.Size(300.0, 300.0),
36 key: 1
37 ),
38 ])),
39 ]),
40 onPointerDown: _handlePointerDown,
41 onGestureTap: _handleGestureTap);
42 }
43
44 void _handlePointerDown(sky.PointerEvent event) {
45 print("_handlePointerDown");
46 }
47
48 void _handleGestureTap(sky.GestureEvent event) {
49 print("_handleGestureTap");
50 }
51 }
52
53 void main() {
54 new ContainerApp();
55 }
OLDNEW
« no previous file with comments | « mojo/public/dart/lib/application.dart ('k') | sky/examples/fn2/hello_fn2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698