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

Unified Diff: sky/examples/raw/render_paragraph.dart

Issue 1162023004: Update BoxDecoration and RenderParagraph to use sky.Color instead of int. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: test expectations Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/examples/fn2/container.dart ('k') | sky/examples/raw/sector_layout.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/raw/render_paragraph.dart
diff --git a/sky/examples/raw/render_paragraph.dart b/sky/examples/raw/render_paragraph.dart
index 24cb1d596c27978c81b94f0efb05e0702a612768..e7e8f6c45374071cf2b6289427ed78427a4d1a6d 100644
--- a/sky/examples/raw/render_paragraph.dart
+++ b/sky/examples/raw/render_paragraph.dart
@@ -11,9 +11,9 @@ import 'package:sky/framework/rendering/paragraph.dart';
class RenderSolidColor extends RenderDecoratedBox {
final Size desiredSize;
- final int backgroundColor;
+ final Color backgroundColor;
- RenderSolidColor(int backgroundColor, { this.desiredSize: const Size.infinite() })
+ RenderSolidColor(Color backgroundColor, { this.desiredSize: const Size.infinite() })
: backgroundColor = backgroundColor,
super(decoration: new BoxDecoration(backgroundColor: backgroundColor));
@@ -27,7 +27,7 @@ class RenderSolidColor extends RenderDecoratedBox {
void handlePointer(PointerEvent event) {
if (event.type == 'pointerdown')
- decoration = new BoxDecoration(backgroundColor: 0xFFFF0000);
+ decoration = new BoxDecoration(backgroundColor: const Color(0xFFFF0000));
else if (event.type == 'pointerup')
decoration = new BoxDecoration(backgroundColor: backgroundColor);
}
@@ -39,11 +39,11 @@ void main() {
RenderFlex flexRoot = new RenderFlex(direction: FlexDirection.Vertical);
RenderNode root = new RenderDecoratedBox(
- decoration: new BoxDecoration(backgroundColor: 0xFF606060),
+ decoration: new BoxDecoration(backgroundColor: const Color(0xFF606060)),
child: flexRoot
);
- RenderNode child = new RenderSolidColor(0xFFFFFF00);
+ RenderNode child = new RenderSolidColor(const Color(0xFFFFFF00));
flexRoot.add(child);
child.parentData.flex = 2;
@@ -55,8 +55,8 @@ alcatra. Pork pork belly alcatra, flank chuck drumstick biltong doner jowl.
Pancetta meatball tongue tenderloin rump tail jowl boudin.""";
child = new RenderDecoratedBox(
- decoration: new BoxDecoration(backgroundColor: 0xFFFFFFFF),
- child: new RenderParagraph(text: meatyString, color: 0xFF009900)
+ decoration: new BoxDecoration(backgroundColor: const Color(0xFFFFFFFF)),
+ child: new RenderParagraph(text: meatyString, color: const Color(0xFF009900))
);
flexRoot.add(child);
child.parentData.flex = 1;
« no previous file with comments | « sky/examples/fn2/container.dart ('k') | sky/examples/raw/sector_layout.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698