diff --git a/engine/src/flutter/examples/fn2/container.dart b/engine/src/flutter/examples/fn2/container.dart index a236a42e271..961650d3d9b 100644 --- a/engine/src/flutter/examples/fn2/container.dart +++ b/engine/src/flutter/examples/fn2/container.dart @@ -14,11 +14,11 @@ class ContainerApp extends App { padding: new EdgeDims.all(10.0), margin: new EdgeDims.all(10.0), desiredSize: new sky.Size(double.INFINITY, 100.0), - decoration: new BoxDecoration(backgroundColor: 0xFF00FF00), + decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFF00FF00)), child: new BlockContainer( children: [ new Container( - decoration: new BoxDecoration(backgroundColor: 0xFFFFFF00), + decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFFFFFF00)), desiredSize: new sky.Size(double.INFINITY, 20.0) ) ])), diff --git a/engine/src/flutter/tests/raw/box_layout-expected.txt b/engine/src/flutter/tests/raw/box_layout-expected.txt index 511893d78a0..a3d0b908bc2 100644 --- a/engine/src/flutter/tests/raw/box_layout-expected.txt +++ b/engine/src/flutter/tests/raw/box_layout-expected.txt @@ -5,12 +5,12 @@ PAINT FOR FRAME #1 ---------------------------------------------- 1 | TestDisplayList() constructor: 800.0 x 600.0 1 | paintChild at 0.0,0.0 1 | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | drawRect(0.0:0.0:600.0:800.0, Paint(0xff0000ff)) +1 | | drawRect(0.0:0.0:600.0:800.0, Paint(Color(0xff0000ff))) 1 | | paintChild at 0.0,0.0 1 | | | TestDisplayList() constructor: 800.0 x 600.0 1 | | | paintChild at 50.0,50.0 1 | | | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | | | drawRect(0.0:0.0:100.0:700.0, Paint(0xff00ff00)) +1 | | | | drawRect(0.0:0.0:100.0:700.0, Paint(Color(0xff00ff00))) ------------------------------------------------------------------------ CONSOLE: PASS: padding CONSOLE: diff --git a/engine/src/flutter/tests/raw/box_layout.dart b/engine/src/flutter/tests/raw/box_layout.dart index 7e686632b24..6572ab9bed1 100644 --- a/engine/src/flutter/tests/raw/box_layout.dart +++ b/engine/src/flutter/tests/raw/box_layout.dart @@ -15,10 +15,10 @@ void main() { test("padding", () { var size = new RenderSizedBox(desiredSize: new sky.Size(double.INFINITY, 100.0)); - var inner = new RenderDecoratedBox(decoration: new BoxDecoration(backgroundColor: 0xFF00FF00), child: size); + var inner = new RenderDecoratedBox(decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFF00FF00)), child: size); var padding = new RenderPadding(padding: new EdgeDims.all(50.0), child: inner); var block = new RenderBlock(children: [padding]); - var outer = new RenderDecoratedBox(decoration: new BoxDecoration(backgroundColor: 0xFF0000FF), child: block); + var outer = new RenderDecoratedBox(decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFF0000FF)), child: block); app = new TestApp(outer); }); } diff --git a/engine/src/flutter/tests/raw/render_box-expected.txt b/engine/src/flutter/tests/raw/render_box-expected.txt index 63daffb92e3..49a9ef1b30e 100644 --- a/engine/src/flutter/tests/raw/render_box-expected.txt +++ b/engine/src/flutter/tests/raw/render_box-expected.txt @@ -5,7 +5,7 @@ PAINT FOR FRAME #1 ---------------------------------------------- 1 | TestDisplayList() constructor: 800.0 x 600.0 1 | paintChild at 0.0,0.0 1 | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | drawRect(0.0:0.0:600.0:800.0, Paint(0xff00ff00)) +1 | | drawRect(0.0:0.0:600.0:800.0, Paint(Color(0xff00ff00))) ------------------------------------------------------------------------ CONSOLE: PASS: should size to render view CONSOLE: diff --git a/engine/src/flutter/tests/raw/render_box.dart b/engine/src/flutter/tests/raw/render_box.dart index bf44896174d..111beb41a42 100644 --- a/engine/src/flutter/tests/raw/render_box.dart +++ b/engine/src/flutter/tests/raw/render_box.dart @@ -14,7 +14,7 @@ void main() { test("should size to render view", () { RenderSizedBox root = new RenderSizedBox( child: new RenderDecoratedBox( - decoration: new BoxDecoration(backgroundColor: 0xFF00FF00) + decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFF00FF00)) ) ); TestView renderView = new TestView(child: root); diff --git a/engine/src/flutter/tests/raw/render_flex-expected.txt b/engine/src/flutter/tests/raw/render_flex-expected.txt index c248cde2eca..a3253435609 100644 --- a/engine/src/flutter/tests/raw/render_flex-expected.txt +++ b/engine/src/flutter/tests/raw/render_flex-expected.txt @@ -5,33 +5,33 @@ PAINT FOR FRAME #1 ---------------------------------------------- 1 | TestDisplayList() constructor: 800.0 x 600.0 1 | paintChild at 0.0,0.0 1 | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | drawRect(0.0:0.0:600.0:800.0, Paint(0xff000000)) +1 | | drawRect(0.0:0.0:600.0:800.0, Paint(Color(0xff000000))) 1 | | paintChild at 0.0,0.0 1 | | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | | drawRect(0.0:0.0:82.5:800.0, Paint(0xffffff00)) +1 | | | drawRect(0.0:0.0:82.5:800.0, Paint(Color(0xffffff00))) 1 | | paintChild at 350.0,82.5 1 | | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | | drawRect(0.0:0.0:100.0:100.0, Paint(0x7700ffff)) +1 | | | drawRect(0.0:0.0:100.0:100.0, Paint(Color(0x7700ffff))) 1 | | paintChild at 0.0,182.5 1 | | | TestDisplayList() constructor: 800.0 x 600.0 1 | | | paintChild at 10.0,10.0 1 | | | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | | | drawRect(0.0:0.0:150.0:780.0, Paint(0xffffffff)) +1 | | | | drawRect(0.0:0.0:150.0:780.0, Paint(Color(0xffffffff))) 1 | | | | paintChild at 0.0,0.0 1 | | | | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | | | | drawRect(0.0:0.0:50.0:780.0, Paint(0xff00ff00)) +1 | | | | | drawRect(0.0:0.0:50.0:780.0, Paint(Color(0xff00ff00))) 1 | | | | paintChild at 0.0,50.0 1 | | | | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | | | | drawRect(0.0:0.0:100.0:780.0, Paint(0x7700ffff)) +1 | | | | | drawRect(0.0:0.0:100.0:780.0, Paint(Color(0x7700ffff))) 1 | | paintChild at 0.0,352.5 1 | | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | | drawRect(0.0:0.0:247.5:800.0, Paint(0xff333333)) +1 | | | drawRect(0.0:0.0:247.5:800.0, Paint(Color(0xff333333))) 1 | | | paintChild at 0.0,0.0 1 | | | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | | | drawRect(0.0:0.0:247.5:266.6666564941406, Paint(0x77ff00ff)) +1 | | | | drawRect(0.0:0.0:247.5:266.6666564941406, Paint(Color(0x77ff00ff))) 1 | | | paintChild at 266.6666666666667,0.0 1 | | | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | | | drawRect(0.0:0.0:247.5:533.3333129882812, Paint(0xff0000ff)) +1 | | | | drawRect(0.0:0.0:247.5:533.3333129882812, Paint(Color(0xff0000ff))) ------------------------------------------------------------------------ CONSOLE: PASS: should flex CONSOLE: diff --git a/engine/src/flutter/tests/raw/render_flex.dart b/engine/src/flutter/tests/raw/render_flex.dart index 322b16447e1..2713b150e97 100644 --- a/engine/src/flutter/tests/raw/render_flex.dart +++ b/engine/src/flutter/tests/raw/render_flex.dart @@ -13,9 +13,9 @@ import 'package:sky/framework/rendering/flex.dart'; class RenderSolidColor extends RenderDecoratedBox { final sky.Size desiredSize; - final int backgroundColor; + final sky.Color backgroundColor; - RenderSolidColor(int backgroundColor, { this.desiredSize: const sky.Size.infinite() }) + RenderSolidColor(sky.Color backgroundColor, { this.desiredSize: const sky.Size.infinite() }) : backgroundColor = backgroundColor, super(decoration: new BoxDecoration(backgroundColor: backgroundColor)) { } @@ -30,7 +30,7 @@ class RenderSolidColor extends RenderDecoratedBox { void handlePointer(sky.PointerEvent event) { if (event.type == 'pointerdown') - decoration = new BoxDecoration(backgroundColor: 0xFFFF0000); + decoration = new BoxDecoration(backgroundColor: const sky.Color(0xFFFF0000)); else if (event.type == 'pointerup') decoration = new BoxDecoration(backgroundColor: backgroundColor); } @@ -45,30 +45,30 @@ void main() { RenderFlex flexRoot = new RenderFlex(direction: FlexDirection.Vertical); RenderDecoratedBox root = new RenderDecoratedBox( - decoration: new BoxDecoration(backgroundColor: 0xFF000000), + decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFF000000)), child: flexRoot ); - void addFlexChildSolidColor(RenderFlex parent, int backgroundColor, { int flex: 0 }) { + void addFlexChildSolidColor(RenderFlex parent, sky.Color backgroundColor, { int flex: 0 }) { RenderSolidColor child = new RenderSolidColor(backgroundColor); parent.add(child); child.parentData.flex = flex; } // Yellow bar at top - addFlexChildSolidColor(flexRoot, 0xFFFFFF00, flex: 1); + addFlexChildSolidColor(flexRoot, const sky.Color(0xFFFFFF00), flex: 1); // Turquoise box - flexRoot.add(new RenderSolidColor(0x7700FFFF, desiredSize: new sky.Size(100.0, 100.0))); + flexRoot.add(new RenderSolidColor(const sky.Color(0x7700FFFF), desiredSize: new sky.Size(100.0, 100.0))); // Green and cyan render block with padding var renderBlock = new RenderBlock(); - renderBlock.add(new RenderSolidColor(0xFF00FF00, desiredSize: new sky.Size(100.0, 50.0))); - renderBlock.add(new RenderSolidColor(0x7700FFFF, desiredSize: new sky.Size(50.0, 100.0))); + renderBlock.add(new RenderSolidColor(const sky.Color(0xFF00FF00), desiredSize: new sky.Size(100.0, 50.0))); + renderBlock.add(new RenderSolidColor(const sky.Color(0x7700FFFF), desiredSize: new sky.Size(50.0, 100.0))); var renderDecoratedBlock = new RenderDecoratedBox( - decoration: new BoxDecoration(backgroundColor: 0xFFFFFFFF), + decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFFFFFFFF)), child: renderBlock ); @@ -77,11 +77,11 @@ void main() { var row = new RenderFlex(direction: FlexDirection.Horizontal); // Purple and blue cells - addFlexChildSolidColor(row, 0x77FF00FF, flex: 1); - addFlexChildSolidColor(row, 0xFF0000FF, flex: 2); + addFlexChildSolidColor(row, const sky.Color(0x77FF00FF), flex: 1); + addFlexChildSolidColor(row, const sky.Color(0xFF0000FF), flex: 2); var decoratedRow = new RenderDecoratedBox( - decoration: new BoxDecoration(backgroundColor: 0xFF333333), + decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFF333333)), child: row );