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'; | 5 import 'dart:sky'; |
6 import 'package:sky/app/view.dart'; | 6 |
7 import 'package:sky/painting/text_style.dart'; | 7 import 'package:sky/painting/text_style.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/object.dart'; | 10 import 'package:sky/rendering/object.dart'; |
10 import 'package:sky/rendering/flex.dart'; | |
11 import 'package:sky/rendering/paragraph.dart'; | 11 import 'package:sky/rendering/paragraph.dart'; |
| 12 import 'package:sky/rendering/sky_binding.dart'; |
| 13 |
12 import '../lib/solid_color_box.dart'; | 14 import '../lib/solid_color_box.dart'; |
13 | 15 |
14 AppView app; | |
15 | |
16 void main() { | 16 void main() { |
17 RenderFlex flexRoot = new RenderFlex(direction: FlexDirection.vertical); | 17 RenderFlex flexRoot = new RenderFlex(direction: FlexDirection.vertical); |
18 | 18 |
19 RenderObject root = new RenderDecoratedBox( | 19 RenderObject root = new RenderDecoratedBox( |
20 decoration: new BoxDecoration(backgroundColor: const Color(0xFF606060)), | 20 decoration: new BoxDecoration(backgroundColor: const Color(0xFF606060)), |
21 child: flexRoot | 21 child: flexRoot |
22 ); | 22 ); |
23 | 23 |
24 RenderObject child = new RenderSolidColorBox(const Color(0xFFFFFF00)); | 24 RenderObject child = new RenderSolidColorBox(const Color(0xFFFFFF00)); |
25 flexRoot.add(child); | 25 flexRoot.add(child); |
26 child.parentData.flex = 2; | 26 child.parentData.flex = 2; |
27 | 27 |
28 // The internet is a beautiful place. https://baconipsum.com/ | 28 // The internet is a beautiful place. https://baconipsum.com/ |
29 String meatyString = """Bacon ipsum dolor amet ham fatback tri-tip, prosciutto | 29 String meatyString = """Bacon ipsum dolor amet ham fatback tri-tip, prosciutto |
30 porchetta bacon kevin meatball meatloaf pig beef ribs chicken. Brisket ribeye | 30 porchetta bacon kevin meatball meatloaf pig beef ribs chicken. Brisket ribeye |
31 andouille leberkas capicola meatloaf. Chicken pig ball tip pork picanha bresaola | 31 andouille leberkas capicola meatloaf. Chicken pig ball tip pork picanha bresaola |
32 alcatra. Pork pork belly alcatra, flank chuck drumstick biltong doner jowl. | 32 alcatra. Pork pork belly alcatra, flank chuck drumstick biltong doner jowl. |
33 Pancetta meatball tongue tenderloin rump tail jowl boudin."""; | 33 Pancetta meatball tongue tenderloin rump tail jowl boudin."""; |
34 | 34 |
35 var text = new InlineStyle( | 35 var text = new InlineStyle( |
36 new TextStyle(color: const Color(0xFF009900)), | 36 new TextStyle(color: const Color(0xFF009900)), |
37 [new InlineText(meatyString)]); | 37 [new InlineText(meatyString)]); |
38 child = new RenderDecoratedBox( | 38 child = new RenderDecoratedBox( |
39 decoration: new BoxDecoration(backgroundColor: const Color(0xFFFFFFFF)), | 39 decoration: new BoxDecoration(backgroundColor: const Color(0xFFFFFFFF)), |
40 child: new RenderParagraph(text) | 40 child: new RenderParagraph(text) |
41 ); | 41 ); |
42 flexRoot.add(child); | 42 flexRoot.add(child); |
43 child.parentData.flex = 1; | 43 child.parentData.flex = 1; |
44 | 44 |
45 app = new AppView(root: root); | 45 new SkyBinding(root: root); |
46 } | 46 } |
OLD | NEW |