| 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 | 6 |
| 7 import 'package:sky/app/scheduler.dart'; | 7 import 'package:sky/app/scheduler.dart'; |
| 8 import 'package:sky/rendering/box.dart'; | 8 import 'package:sky/rendering/box.dart'; |
| 9 import 'package:sky/rendering/flex.dart'; | 9 import 'package:sky/rendering/flex.dart'; |
| 10 import 'package:sky/widgets/basic.dart'; | 10 import 'package:sky/widgets/basic.dart'; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 return new Flexible( | 30 return new Flexible( |
| 31 child: new Container( | 31 child: new Container( |
| 32 decoration: new BoxDecoration(backgroundColor: color) | 32 decoration: new BoxDecoration(backgroundColor: color) |
| 33 ) | 33 ) |
| 34 ); | 34 ); |
| 35 } | 35 } |
| 36 } | 36 } |
| 37 | 37 |
| 38 Widget builder() { | 38 Widget builder() { |
| 39 return new Flex([ | 39 return new Flex([ |
| 40 new Rectangle(const Color(0xFF00FFFF), key: 'a'), | 40 new Rectangle(const Color(0xFF00FFFF)), |
| 41 new Container( | 41 new Container( |
| 42 padding: new EdgeDims.all(10.0), | 42 padding: new EdgeDims.all(10.0), |
| 43 margin: new EdgeDims.all(10.0), | 43 margin: new EdgeDims.all(10.0), |
| 44 decoration: new BoxDecoration(backgroundColor: const Color(0xFFCCCCCC)), | 44 decoration: new BoxDecoration(backgroundColor: const Color(0xFFCCCCCC)), |
| 45 child: new RaisedButton( | 45 child: new RaisedButton( |
| 46 child: new Flex([ | 46 child: new Flex([ |
| 47 new Image(src: "https://www.dartlang.org/logos/dart-logo.png"), | 47 new Image(src: "https://www.dartlang.org/logos/dart-logo.png"), |
| 48 new Text('PRESS ME'), | 48 new Text('PRESS ME'), |
| 49 ]), | 49 ]), |
| 50 onPressed: () => print("Hello World") | 50 onPressed: () => print("Hello World") |
| 51 ) | 51 ) |
| 52 ), | 52 ), |
| 53 new Rectangle(const Color(0xFFFFFF00), key: 'b'), | 53 new Rectangle(const Color(0xFFFFFF00)), |
| 54 ], | 54 ], |
| 55 direction: FlexDirection.vertical, | 55 direction: FlexDirection.vertical, |
| 56 justifyContent: FlexJustifyContent.spaceBetween | 56 justifyContent: FlexJustifyContent.spaceBetween |
| 57 ); | 57 ); |
| 58 } | 58 } |
| 59 | 59 |
| 60 double timeBase; | 60 double timeBase; |
| 61 RenderTransform transformBox; | 61 RenderTransform transformBox; |
| 62 | 62 |
| 63 final TestRenderView tester = new TestRenderView(); | 63 final TestRenderView tester = new TestRenderView(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 90 addFlexChildSolidColor(flexRoot, const sky.Color(0xFFFF00FF), flex: 1); | 90 addFlexChildSolidColor(flexRoot, const sky.Color(0xFFFF00FF), flex: 1); |
| 91 flexRoot.add(proxy); | 91 flexRoot.add(proxy); |
| 92 addFlexChildSolidColor(flexRoot, const sky.Color(0xFF0000FF), flex: 1); | 92 addFlexChildSolidColor(flexRoot, const sky.Color(0xFF0000FF), flex: 1); |
| 93 | 93 |
| 94 transformBox = new RenderTransform(child: flexRoot, transform: new Matrix4.ide
ntity()); | 94 transformBox = new RenderTransform(child: flexRoot, transform: new Matrix4.ide
ntity()); |
| 95 RenderPadding root = new RenderPadding(padding: new EdgeDims.all(20.0), child:
transformBox); | 95 RenderPadding root = new RenderPadding(padding: new EdgeDims.all(20.0), child:
transformBox); |
| 96 | 96 |
| 97 WidgetAppView.appView.root = root; | 97 WidgetAppView.appView.root = root; |
| 98 addPersistentFrameCallback(rotate); | 98 addPersistentFrameCallback(rotate); |
| 99 } | 99 } |
| OLD | NEW |