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 | 8 |
9 class ContainerApp extends App { | 9 class ContainerApp extends App { |
10 UINode build() { | 10 UINode build() { |
11 return new EventListenerNode( | 11 return new EventListenerNode( |
12 new BlockContainer(children: [ | 12 new BlockContainer(children: [ |
13 new Rectangle(0xFF00FFFF, key: 1), | |
14 new Container( | 13 new Container( |
15 padding: new EdgeDims.all(10.0), | 14 padding: new EdgeDims.all(10.0), |
16 margin: new EdgeDims.all(10.0), | 15 margin: new EdgeDims.all(10.0), |
17 desiredSize: new sky.Size(double.INFINITY, 100.0), | 16 desiredSize: new sky.Size(double.INFINITY, 100.0), |
18 decoration: new BoxDecoration(backgroundColor: 0xFF00FF00), | 17 decoration: new BoxDecoration(backgroundColor: 0xFF00FF00), |
19 child: new BlockContainer( | 18 child: new BlockContainer( |
20 children: [ | 19 children: [ |
21 new Container( | 20 new Container( |
22 decoration: new BoxDecoration(backgroundColor: 0xFFFFFF00)
, | 21 decoration: new BoxDecoration(backgroundColor: 0xFFFFFF00)
, |
23 desiredSize: new sky.Size(double.INFINITY, 20.0) | 22 desiredSize: new sky.Size(double.INFINITY, 20.0) |
24 ) | 23 ) |
25 ])), | 24 ])), |
26 new Rectangle(0xFF0000FF, key: 3) | |
27 ]), | 25 ]), |
28 onPointerDown: _handlePointerDown); | 26 onPointerDown: _handlePointerDown); |
29 } | 27 } |
30 | 28 |
31 void _handlePointerDown(sky.PointerEvent event) { | 29 void _handlePointerDown(sky.PointerEvent event) { |
32 print("_handlePointerDown"); | 30 print("_handlePointerDown"); |
33 } | 31 } |
34 } | 32 } |
35 | 33 |
36 void main() { | 34 void main() { |
37 new ContainerApp(); | 35 new ContainerApp(); |
38 } | 36 } |
OLD | NEW |