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

Side by Side Diff: sky/sdk/example/rendering/interactive_flex.dart

Issue 1218293017: Deploy TaskDescription to the rest of our demos (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « sky/sdk/example/mine_digger/lib/main.dart ('k') | sky/sdk/example/widgets/sector.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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'; 5 import 'dart:sky';
6 import 'dart:math' as math; 6 import 'dart:math' as math;
7 7
8 import 'package:sky/mojo/activity.dart' as activity; 8 import 'package:sky/mojo/activity.dart' as activity;
9 import 'package:sky/mojo/net/image_cache.dart' as image_cache; 9 import 'package:sky/mojo/net/image_cache.dart' as image_cache;
10 import 'package:sky/painting/text_style.dart'; 10 import 'package:sky/painting/text_style.dart';
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 image_cache.load("https://www.dartlang.org/logos/dart-logo.png").then((Image d artLogo) { 68 image_cache.load("https://www.dartlang.org/logos/dart-logo.png").then((Image d artLogo) {
69 image.image = dartLogo; 69 image.image = dartLogo;
70 }); 70 });
71 71
72 var padding = new RenderPadding(padding: const EdgeDims.all(10.0), child: imag e); 72 var padding = new RenderPadding(padding: const EdgeDims.all(10.0), child: imag e);
73 row.add(padding); 73 row.add(padding);
74 74
75 RenderFlex column = new RenderFlex(direction: FlexDirection.vertical); 75 RenderFlex column = new RenderFlex(direction: FlexDirection.vertical);
76 76
77 // Top cell 77 // Top cell
78 addFlexChildSolidColor(column, const Color(0xFF55DDCA), flex: 1); 78 final Color topColor = const Color(0xFF55DDCA);
79 addFlexChildSolidColor(column, topColor, flex: 1);
79 80
80 // The internet is a beautiful place. https://baconipsum.com/ 81 // The internet is a beautiful place. https://baconipsum.com/
81 String meatyString = """Bacon ipsum dolor amet ham fatback tri-tip, prosciutto 82 String meatyString = """Bacon ipsum dolor amet ham fatback tri-tip, prosciutto
82 porchetta bacon kevin meatball meatloaf pig beef ribs chicken. Brisket ribeye 83 porchetta bacon kevin meatball meatloaf pig beef ribs chicken. Brisket ribeye
83 andouille leberkas capicola meatloaf. Chicken pig ball tip pork picanha bresaola 84 andouille leberkas capicola meatloaf. Chicken pig ball tip pork picanha bresaola
84 alcatra. Pork pork belly alcatra, flank chuck drumstick biltong doner jowl. 85 alcatra. Pork pork belly alcatra, flank chuck drumstick biltong doner jowl.
85 Pancetta meatball tongue tenderloin rump tail jowl boudin."""; 86 Pancetta meatball tongue tenderloin rump tail jowl boudin.""";
86 var text = new InlineStyle( 87 var text = new InlineStyle(
87 new TextStyle(color: const Color(0xFF009900)), 88 new TextStyle(color: const Color(0xFF009900)),
88 [new InlineText(meatyString)]); 89 [new InlineText(meatyString)]);
89 padding = new RenderPadding( 90 padding = new RenderPadding(
90 padding: const EdgeDims.all(10.0), 91 padding: const EdgeDims.all(10.0),
91 child: new RenderParagraph(text)); 92 child: new RenderParagraph(text));
92 column.add(padding); 93 column.add(padding);
93 94
94 // Bottom cell 95 // Bottom cell
95 addFlexChildSolidColor(column, const Color(0xFF0081C6), flex: 2); 96 addFlexChildSolidColor(column, const Color(0xFF0081C6), flex: 2);
96 97
97 row.add(column); 98 row.add(column);
98 column.parentData.flex = 8; 99 column.parentData.flex = 8;
99 100
100 RenderDecoratedBox root = new RenderDecoratedBox( 101 RenderDecoratedBox root = new RenderDecoratedBox(
101 decoration: new BoxDecoration(backgroundColor: const Color(0xFFFFFFFF)), 102 decoration: new BoxDecoration(backgroundColor: const Color(0xFFFFFFFF)),
102 child: row 103 child: row
103 ); 104 );
104 105
106 activity.updateTaskDescription('Interactive Flex', topColor);
105 new SkyBinding(root: root); 107 new SkyBinding(root: root);
106 view.setEventCallback(handleEvent); 108 view.setEventCallback(handleEvent);
107 } 109 }
OLDNEW
« no previous file with comments | « sky/sdk/example/mine_digger/lib/main.dart ('k') | sky/sdk/example/widgets/sector.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698