diff --git a/examples/fn2/container.dart b/examples/fn2/container.dart index a236a42e27..961650d3d9 100644 --- a/examples/fn2/container.dart +++ b/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/examples/raw/render_paragraph.dart b/examples/raw/render_paragraph.dart index 24cb1d596c..e7e8f6c453 100644 --- a/examples/raw/render_paragraph.dart +++ b/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; diff --git a/examples/raw/sector_layout.dart b/examples/raw/sector_layout.dart index 968c4f5d51..21a1bfa434 100644 --- a/examples/raw/sector_layout.dart +++ b/examples/raw/sector_layout.dart @@ -463,7 +463,7 @@ class RenderBoxToRenderSectorAdapter extends RenderBox { } class RenderSolidColor extends RenderDecoratedSector { - RenderSolidColor(int backgroundColor, { + RenderSolidColor(sky.Color backgroundColor, { this.desiredDeltaRadius: double.INFINITY, this.desiredDeltaTheta: kTwoPi }) : this.backgroundColor = backgroundColor, @@ -471,7 +471,7 @@ class RenderSolidColor extends RenderDecoratedSector { double desiredDeltaRadius; double desiredDeltaTheta; - final int backgroundColor; + final sky.Color backgroundColor; SectorDimensions getIntrinsicDimensions(SectorConstraints constraints, double radius) { return new SectorDimensions.withConstraints(constraints, deltaTheta: 1.0); // 1.0 radians @@ -484,7 +484,7 @@ class RenderSolidColor extends RenderDecoratedSector { 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); } @@ -495,12 +495,12 @@ AppView app; void main() { var rootCircle = new RenderSectorRing(padding: 20.0); - rootCircle.add(new RenderSolidColor(0xFF00FFFF, desiredDeltaTheta: kTwoPi * 0.15)); - rootCircle.add(new RenderSolidColor(0xFF0000FF, desiredDeltaTheta: kTwoPi * 0.4)); + rootCircle.add(new RenderSolidColor(const sky.Color(0xFF00FFFF), desiredDeltaTheta: kTwoPi * 0.15)); + rootCircle.add(new RenderSolidColor(const sky.Color(0xFF0000FF), desiredDeltaTheta: kTwoPi * 0.4)); var stack = new RenderSectorSlice(padding: 2.0); - stack.add(new RenderSolidColor(0xFFFFFF00, desiredDeltaRadius: 20.0)); - stack.add(new RenderSolidColor(0xFFFF9000, desiredDeltaRadius: 20.0)); - stack.add(new RenderSolidColor(0xFF00FF00)); + stack.add(new RenderSolidColor(const sky.Color(0xFFFFFF00), desiredDeltaRadius: 20.0)); + stack.add(new RenderSolidColor(const sky.Color(0xFFFF9000), desiredDeltaRadius: 20.0)); + stack.add(new RenderSolidColor(const sky.Color(0xFF00FF00))); rootCircle.add(stack); var root = new RenderBoxToRenderSectorAdapter(innerRadius: 50.0, child: rootCircle); diff --git a/examples/raw/transform.dart b/examples/raw/transform.dart index b5c04a58da..5c895977c9 100644 --- a/examples/raw/transform.dart +++ b/examples/raw/transform.dart @@ -12,7 +12,7 @@ AppView app; void main() { RenderDecoratedBox green = new RenderDecoratedBox( - decoration: new BoxDecoration(backgroundColor: 0xFF00FF00)); + decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFF00FF00))); RenderSizedBox box = new RenderSizedBox( desiredSize: new sky.Size(200.0, 200.0), child: green); diff --git a/examples/stocks2/lib/stock_app.dart b/examples/stocks2/lib/stock_app.dart index 6f72f8cf33..03c33f837d 100644 --- a/examples/stocks2/lib/stock_app.dart +++ b/examples/stocks2/lib/stock_app.dart @@ -209,7 +209,7 @@ class StocksApp extends App { return new Container( child: new BlockContainer(children: [buildToolBar()]), decoration: new BoxDecoration( - backgroundColor: 0xFFFFFFFF + backgroundColor: const sky.Color(0xFFFFFFFF) ) );