OLD | NEW |
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' as sky; | 5 import 'dart:sky' as sky; |
6 import 'package:sky/framework/fn2.dart'; | 6 import 'package:sky/framework/fn2.dart'; |
7 import 'package:sky/framework/rendering/box.dart'; | 7 import 'package:sky/framework/rendering/box.dart'; |
| 8 import '../lib/solid_color_box.dart'; |
| 9 |
| 10 class Rectangle extends RenderNodeWrapper { |
| 11 RenderSolidColor root; |
| 12 RenderSolidColor createNode() => |
| 13 new RenderSolidColor(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 } |
8 | 19 |
9 class ContainerApp extends App { | 20 class ContainerApp extends App { |
10 UINode build() { | 21 UINode build() { |
11 return new EventListenerNode( | 22 return new EventListenerNode( |
12 new BlockContainer(children: [ | 23 new BlockContainer(children: [ |
13 new Rectangle(0xFF00FFFF, key: 1), | 24 new Rectangle(0xFF00FFFF, key: 1), |
14 new Container( | 25 new Container( |
15 padding: new EdgeDims.all(10.0), | 26 padding: new EdgeDims.all(10.0), |
16 margin: new EdgeDims.all(10.0), | 27 margin: new EdgeDims.all(10.0), |
17 desiredSize: new sky.Size(double.INFINITY, 100.0), | 28 desiredSize: new sky.Size(double.INFINITY, 100.0), |
(...skipping 11 matching lines...) Expand all Loading... |
29 } | 40 } |
30 | 41 |
31 void _handlePointerDown(sky.PointerEvent event) { | 42 void _handlePointerDown(sky.PointerEvent event) { |
32 print("_handlePointerDown"); | 43 print("_handlePointerDown"); |
33 } | 44 } |
34 } | 45 } |
35 | 46 |
36 void main() { | 47 void main() { |
37 new ContainerApp(); | 48 new ContainerApp(); |
38 } | 49 } |
OLD | NEW |