Commit d5fe622a authored by Eric Seidel's avatar Eric Seidel

Fix analyzer warnings

We had a remarkable number of analyzer failures.

I'll fix the bots to analyze across the whole project
in a follow-up patch, that should prevent this
in the future.

@abarth
parent fca0c3c9
...@@ -8,7 +8,7 @@ Picture draw(int a, int r, int g, int b) { ...@@ -8,7 +8,7 @@ Picture draw(int a, int r, int g, int b) {
Size size = new Size(view.width, view.height); Size size = new Size(view.width, view.height);
PictureRecorder recorder = new PictureRecorder(); PictureRecorder recorder = new PictureRecorder();
final double devicePixelRatio = sky.view.devicePixelRatio; final double devicePixelRatio = view.devicePixelRatio;
Canvas canvas = new Canvas(recorder, Point.origin & (size * devicePixelRatio)); Canvas canvas = new Canvas(recorder, Point.origin & (size * devicePixelRatio));
canvas.scale(devicePixelRatio, devicePixelRatio); canvas.scale(devicePixelRatio, devicePixelRatio);
double radius = size.shortestSide * 0.45; double radius = size.shortestSide * 0.45;
......
...@@ -21,7 +21,7 @@ Picture draw(int a, int r, int g, int b) { ...@@ -21,7 +21,7 @@ Picture draw(int a, int r, int g, int b) {
paintingNode = new PaintingNode(); paintingNode = new PaintingNode();
Paint innerPaint = new Paint()..color = new Color.fromARGB(a, 255 - r, 255 - g, 255 - b); Paint innerPaint = new Paint()..color = new Color.fromARGB(a, 255 - r, 255 - g, 255 - b);
PictureRecorder innerRecorder = new PictureRecorder(); PictureRecorder innerRecorder = new PictureRecorder();
Canvas innerCanvas = new Canvas(innerRecorder, Point.origin & bounds); Canvas innerCanvas = new Canvas(innerRecorder, Point.origin & size);
innerCanvas.drawCircle(size.center(Point.origin), radius * 0.5, innerPaint); innerCanvas.drawCircle(size.center(Point.origin), radius * 0.5, innerPaint);
paintingNode.setBackingDrawable(innerRecorder.endRecordingAsDrawable()); paintingNode.setBackingDrawable(innerRecorder.endRecordingAsDrawable());
......
...@@ -21,11 +21,11 @@ void beginFrame(double timeStamp) { ...@@ -21,11 +21,11 @@ void beginFrame(double timeStamp) {
..setPaintBits(PaintBits.all) ..setPaintBits(PaintBits.all)
..setOffset(const Offset(5.0, 5.0)) ..setOffset(const Offset(5.0, 5.0))
..setColorMode(TransferMode.src), ..setColorMode(TransferMode.src),
(Paint layerPaint) { new Paint()
layerPaint.color = const Color.fromARGB(128, 55, 55, 55); ..color = const Color.fromARGB(128, 55, 55, 55)
layerPaint.setMaskFilter( ..setMaskFilter(
new MaskFilter.blur(BlurStyle.normal, 5.0, highQuality: true)); new MaskFilter.blur(BlurStyle.normal, 5.0, highQuality: true))
}) )
// Main layer. // Main layer.
..addLayerOnTop(new DrawLooperLayerInfo(), new Paint()); ..addLayerOnTop(new DrawLooperLayerInfo(), new Paint());
paint.setDrawLooper(builder.build()); paint.setDrawLooper(builder.build());
......
...@@ -20,7 +20,7 @@ void beginFrame(double timeStamp) { ...@@ -20,7 +20,7 @@ void beginFrame(double timeStamp) {
PictureRecorder recorder = new PictureRecorder(); PictureRecorder recorder = new PictureRecorder();
final double devicePixelRatio = view.devicePixelRatio; final double devicePixelRatio = view.devicePixelRatio;
Canvas canvas = new Canvas(recorder, Point.origin & new Size(view.width * devicePixelRatio, view.height * devicePixelRatio)); Canvas canvas = new Canvas(recorder, Point.origin & new Size(view.width * devicePixelRatio, view.height * devicePixelRatio));
cavnas.scale(devicePixelRatio, devicePixelRatio); canvas.scale(devicePixelRatio, devicePixelRatio);
canvas.translate(view.width / 2.0, view.height / 2.0); canvas.translate(view.width / 2.0, view.height / 2.0);
canvas.rotate(math.PI * delta / 1800); canvas.rotate(math.PI * delta / 1800);
canvas.scale(0.2, 0.2); canvas.scale(0.2, 0.2);
...@@ -61,7 +61,7 @@ bool handleEvent(Event event) { ...@@ -61,7 +61,7 @@ bool handleEvent(Event event) {
} }
if (event.type == "pointerup") { if (event.type == "pointerup") {
image_cache.load(url2).then(handleImageLoad); image_cache.load(url2).first.then(handleImageLoad);
return true; return true;
} }
...@@ -69,7 +69,7 @@ bool handleEvent(Event event) { ...@@ -69,7 +69,7 @@ bool handleEvent(Event event) {
} }
void main() { void main() {
image_cache.load(url1).then(handleImageLoad); image_cache.load(url1).first.then(handleImageLoad);
view.setEventCallback(handleEvent); view.setEventCallback(handleEvent);
view.setFrameCallback(beginFrame); view.setFrameCallback(beginFrame);
} }
...@@ -18,25 +18,25 @@ void main() { ...@@ -18,25 +18,25 @@ void main() {
for(FlexAlignItems alignItems in FlexAlignItems.values) { for(FlexAlignItems alignItems in FlexAlignItems.values) {
TextStyle style = const TextStyle(color: const Color(0xFF000000)); TextStyle style = const TextStyle(color: const Color(0xFF000000));
RenderParagraph paragraph = new RenderParagraph(new RenderStyled(style, [new RenderText("${alignItems}")])); RenderParagraph paragraph = new RenderParagraph(new StyledTextSpan(style, [new PlainTextSpan("${alignItems}")]));
table.add(new RenderPadding(child: paragraph, padding: new EdgeDims.only(top: 20.0))); table.add(new RenderPadding(child: paragraph, padding: new EdgeDims.only(top: 20.0)));
var row = new RenderFlex(alignItems: alignItems, textBaseline: TextBaseline.alphabetic); var row = new RenderFlex(alignItems: alignItems, textBaseline: TextBaseline.alphabetic);
style = new TextStyle(fontSize: 15.0, color: const Color(0xFF000000)); style = new TextStyle(fontSize: 15.0, color: const Color(0xFF000000));
row.add(new RenderDecoratedBox( row.add(new RenderDecoratedBox(
decoration: new BoxDecoration(backgroundColor: const Color(0x7FFFCCCC)), decoration: new BoxDecoration(backgroundColor: const Color(0x7FFFCCCC)),
child: new RenderParagraph(new RenderStyled(style, [new RenderText('foo foo foo')])) child: new RenderParagraph(new StyledTextSpan(style, [new PlainTextSpan('foo foo foo')]))
)); ));
style = new TextStyle(fontSize: 10.0, color: const Color(0xFF000000)); style = new TextStyle(fontSize: 10.0, color: const Color(0xFF000000));
row.add(new RenderDecoratedBox( row.add(new RenderDecoratedBox(
decoration: new BoxDecoration(backgroundColor: const Color(0x7FCCFFCC)), decoration: new BoxDecoration(backgroundColor: const Color(0x7FCCFFCC)),
child: new RenderParagraph(new RenderStyled(style, [new RenderText('foo foo foo')])) child: new RenderParagraph(new StyledTextSpan(style, [new PlainTextSpan('foo foo foo')]))
)); ));
var subrow = new RenderFlex(alignItems: alignItems, textBaseline: TextBaseline.alphabetic); var subrow = new RenderFlex(alignItems: alignItems, textBaseline: TextBaseline.alphabetic);
style = new TextStyle(fontSize: 25.0, color: const Color(0xFF000000)); style = new TextStyle(fontSize: 25.0, color: const Color(0xFF000000));
subrow.add(new RenderDecoratedBox( subrow.add(new RenderDecoratedBox(
decoration: new BoxDecoration(backgroundColor: const Color(0x7FCCCCFF)), decoration: new BoxDecoration(backgroundColor: const Color(0x7FCCCCFF)),
child: new RenderParagraph(new RenderStyled(style, [new RenderText('foo foo foo foo')])) child: new RenderParagraph(new StyledTextSpan(style, [new PlainTextSpan('foo foo foo foo')]))
)); ));
subrow.add(new RenderSolidColorBox(const Color(0x7FCCFFFF), desiredSize: new Size(30.0, 40.0))); subrow.add(new RenderSolidColorBox(const Color(0x7FCCFFFF), desiredSize: new Size(30.0, 40.0)));
row.add(subrow); row.add(subrow);
......
...@@ -13,19 +13,19 @@ import 'package:sky/rendering/sky_binding.dart'; ...@@ -13,19 +13,19 @@ import 'package:sky/rendering/sky_binding.dart';
RenderBox getBox(double lh) { RenderBox getBox(double lh) {
RenderParagraph paragraph = new RenderParagraph( RenderParagraph paragraph = new RenderParagraph(
new RenderStyled( new StyledTextSpan(
new TextStyle( new TextStyle(
color: const Color(0xFF0000A0) color: const Color(0xFF0000A0)
), ),
[ [
new RenderText('test'), new PlainTextSpan('test'),
new RenderStyled( new StyledTextSpan(
new TextStyle( new TextStyle(
fontFamily: 'serif', fontFamily: 'serif',
fontSize: 50.0, fontSize: 50.0,
height: lh height: lh
), ),
[new RenderText('مرحبا Hello')] [new PlainTextSpan('مرحبا Hello')]
) )
] ]
) )
......
...@@ -65,7 +65,7 @@ void main() { ...@@ -65,7 +65,7 @@ void main() {
// Resizeable image // Resizeable image
image = new RenderImageGrow(null, new Size(100.0, null)); image = new RenderImageGrow(null, new Size(100.0, null));
image_cache.load("https://www.dartlang.org/logos/dart-logo.png").then((Image dartLogo) { image_cache.load("https://www.dartlang.org/logos/dart-logo.png").first.then((Image dartLogo) {
image.image = dartLogo; image.image = dartLogo;
}); });
...@@ -84,9 +84,9 @@ porchetta bacon kevin meatball meatloaf pig beef ribs chicken. Brisket ribeye ...@@ -84,9 +84,9 @@ porchetta bacon kevin meatball meatloaf pig beef ribs chicken. Brisket ribeye
andouille leberkas capicola meatloaf. Chicken pig ball tip pork picanha bresaola andouille leberkas capicola meatloaf. Chicken pig ball tip pork picanha bresaola
alcatra. Pork pork belly alcatra, flank chuck drumstick biltong doner jowl. alcatra. Pork pork belly alcatra, flank chuck drumstick biltong doner jowl.
Pancetta meatball tongue tenderloin rump tail jowl boudin."""; Pancetta meatball tongue tenderloin rump tail jowl boudin.""";
var text = new RenderStyled( var text = new StyledTextSpan(
new TextStyle(color: const Color(0xFF009900)), new TextStyle(color: const Color(0xFF009900)),
[new RenderText(meatyString)]); [new PlainTextSpan(meatyString)]);
padding = new RenderPadding( padding = new RenderPadding(
padding: const EdgeDims.all(10.0), padding: const EdgeDims.all(10.0),
child: new RenderParagraph(text)); child: new RenderParagraph(text));
......
...@@ -21,7 +21,7 @@ void main() { ...@@ -21,7 +21,7 @@ void main() {
var table = new RenderFlex(direction: FlexDirection.vertical); var table = new RenderFlex(direction: FlexDirection.vertical);
void addRow(FlexJustifyContent justify) { void addRow(FlexJustifyContent justify) {
RenderParagraph paragraph = new RenderParagraph(new RenderStyled(style, [new RenderText("${justify}")])); RenderParagraph paragraph = new RenderParagraph(new StyledTextSpan(style, [new PlainTextSpan("${justify}")]));
table.add(new RenderPadding(child: paragraph, padding: new EdgeDims.only(top: 20.0))); table.add(new RenderPadding(child: paragraph, padding: new EdgeDims.only(top: 20.0)));
var row = new RenderFlex(direction: FlexDirection.horizontal); var row = new RenderFlex(direction: FlexDirection.horizontal);
row.add(new RenderSolidColorBox(const Color(0xFFFFCCCC), desiredSize: new Size(80.0, 60.0))); row.add(new RenderSolidColorBox(const Color(0xFFFFCCCC), desiredSize: new Size(80.0, 60.0)));
......
...@@ -32,9 +32,9 @@ andouille leberkas capicola meatloaf. Chicken pig ball tip pork picanha bresaola ...@@ -32,9 +32,9 @@ andouille leberkas capicola meatloaf. Chicken pig ball tip pork picanha bresaola
alcatra. Pork pork belly alcatra, flank chuck drumstick biltong doner jowl. alcatra. Pork pork belly alcatra, flank chuck drumstick biltong doner jowl.
Pancetta meatball tongue tenderloin rump tail jowl boudin."""; Pancetta meatball tongue tenderloin rump tail jowl boudin.""";
var text = new RenderStyled( var text = new StyledTextSpan(
new TextStyle(color: const Color(0xFF009900)), new TextStyle(color: const Color(0xFF009900)),
[new RenderText(meatyString)]); [new PlainTextSpan(meatyString)]);
child = new RenderDecoratedBox( child = new RenderDecoratedBox(
decoration: new BoxDecoration(backgroundColor: const Color(0xFFFFFFFF)), decoration: new BoxDecoration(backgroundColor: const Color(0xFFFFFFFF)),
child: new RenderParagraph(text) child: new RenderParagraph(text)
......
...@@ -76,12 +76,12 @@ class RenderTouchDemo extends RenderBox { ...@@ -76,12 +76,12 @@ class RenderTouchDemo extends RenderBox {
..color = const Color(0xFFFFFFFF); ..color = const Color(0xFFFFFFFF);
canvas.drawRect(offset & size, white); canvas.drawRect(offset & size, white);
for (Dot dot in dots.values) for (Dot dot in dots.values)
dot.paint(canvas, offset); dot.paint(context, offset);
} }
} }
void main() { void main() {
var paragraph = new RenderParagraph(new RenderText("Touch me!")); var paragraph = new RenderParagraph(new PlainTextSpan("Touch me!"));
var stack = new RenderStack(children: [ var stack = new RenderStack(children: [
new RenderTouchDemo(), new RenderTouchDemo(),
paragraph, paragraph,
......
...@@ -20,12 +20,12 @@ import 'package:sky/widgets/transitions.dart'; ...@@ -20,12 +20,12 @@ import 'package:sky/widgets/transitions.dart';
class ProgressIndicatorApp extends App { class ProgressIndicatorApp extends App {
AnimationPerformance valueAnimation; ValueAnimation<double> valueAnimation;
Direction valueAnimationDirection = Direction.forward; Direction valueAnimationDirection = Direction.forward;
void initState() { void initState() {
super.initState(); super.initState();
valueAnimation = new AnimationPerformance() valueAnimation = new ValueAnimation<double>()
..duration = const Duration(milliseconds: 1500) ..duration = const Duration(milliseconds: 1500)
..variable = new AnimatedValue<double>( ..variable = new AnimatedValue<double>(
0.0, 0.0,
...@@ -59,17 +59,17 @@ class ProgressIndicatorApp extends App { ...@@ -59,17 +59,17 @@ class ProgressIndicatorApp extends App {
), ),
new LinearProgressIndicator(), new LinearProgressIndicator(),
new LinearProgressIndicator(), new LinearProgressIndicator(),
new LinearProgressIndicator(value: valueAnimation.variable.value), new LinearProgressIndicator(value: valueAnimation.value),
new CircularProgressIndicator(), new CircularProgressIndicator(),
new SizedBox( new SizedBox(
width: 20.0, width: 20.0,
height: 20.0, height: 20.0,
child: new CircularProgressIndicator(value: valueAnimation.variable.value) child: new CircularProgressIndicator(value: valueAnimation.value)
), ),
new SizedBox( new SizedBox(
width: 50.0, width: 50.0,
height: 30.0, height: 30.0,
child: new CircularProgressIndicator(value: valueAnimation.variable.value) child: new CircularProgressIndicator(value: valueAnimation.value)
) )
]; ];
return new Flex( return new Flex(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment