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