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

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

Issue 1158983005: Implement Container in fn2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: nit 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
OLDNEW
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 }
OLDNEW
« no previous file with comments | « no previous file | sky/sdk/lib/framework/components2/scaffold.dart » ('j') | sky/sdk/lib/framework/fn2.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698