Fix warnings seen when running skyanalyzer in strong mode

This commit is contained in:
Jason Simmons
2015-10-13 16:04:12 -07:00
parent 6e91cfa49a
commit 5b72a2fdaf
39 changed files with 219 additions and 206 deletions

View File

@@ -11,7 +11,7 @@ void main() {
backgroundColor: const Color(0xFF00FF00),
gradient: new RadialGradient(
center: Point.origin, radius: 500.0,
colors: [Colors.yellow[500], Colors.blue[500]]),
colors: <Color>[Colors.yellow[500], Colors.blue[500]]),
boxShadow: shadows[3])
);
layout(root);
@@ -34,7 +34,7 @@ void main() {
child: inner
);
RenderBox flex = new RenderFlex(
children: [padding],
children: <RenderBox>[padding],
direction: FlexDirection.vertical,
alignItems: FlexAlignItems.stretch
);

View File

@@ -6,7 +6,7 @@ import 'rendering_tester.dart';
void main() {
test('Overconstrained flex', () {
RenderDecoratedBox box = new RenderDecoratedBox(decoration: new BoxDecoration());
RenderFlex flex = new RenderFlex(children: [ box ]);
RenderFlex flex = new RenderFlex(children: <RenderBox>[box]);
layout(flex, constraints: const BoxConstraints(
minWidth: 200.0, maxWidth: 100.0, minHeight: 200.0, maxHeight: 100.0)
);
@@ -24,7 +24,7 @@ void main() {
test('Parent data', () {
RenderDecoratedBox box1 = new RenderDecoratedBox(decoration: new BoxDecoration());
RenderDecoratedBox box2 = new RenderDecoratedBox(decoration: new BoxDecoration());
RenderFlex flex = new RenderFlex(children: [ box1, box2 ]);
RenderFlex flex = new RenderFlex(children: <RenderBox>[box1, box2]);
layout(flex, constraints: const BoxConstraints(
minWidth: 0.0, maxWidth: 100.0, minHeight: 0.0, maxHeight: 100.0)
);
@@ -33,7 +33,8 @@ void main() {
expect(box2.size.width, equals(0.0));
expect(box2.size.height, equals(0.0));
box2.parentData.flex = 1;
final FlexParentData box2ParentData = box2.parentData;
box2ParentData.flex = 1;
flex.markNeedsLayout();
pumpFrame();
expect(box1.size.width, equals(0.0));
@@ -47,8 +48,9 @@ void main() {
RenderDecoratedBox box2 = new RenderDecoratedBox(decoration: new BoxDecoration());
RenderFlex flex = new RenderFlex();
flex.setupParentData(box2);
box2.parentData.flex = 2;
flex.addAll([box1, box2]);
final FlexParentData box2ParentData = box2.parentData;
box2ParentData.flex = 2;
flex.addAll(<RenderBox>[box1, box2]);
layout(flex, constraints: const BoxConstraints(
minWidth: 0.0, maxWidth: 100.0, minHeight: 0.0, maxHeight: 100.0)
);

View File

@@ -5,7 +5,7 @@ import 'rendering_tester.dart';
void main() {
test('Basic grid layout test', () {
List<RenderBox> children = [
List<RenderBox> children = <RenderBox>[
new RenderDecoratedBox(decoration: new BoxDecoration()),
new RenderDecoratedBox(decoration: new BoxDecoration()),
new RenderDecoratedBox(decoration: new BoxDecoration()),
@@ -15,7 +15,7 @@ void main() {
RenderGrid grid = new RenderGrid(children: children, maxChildExtent: 100.0);
layout(grid, constraints: const BoxConstraints(maxWidth: 200.0));
children.forEach((child) {
children.forEach((RenderBox child) {
expect(child.size.width, equals(100.0), reason: "child width");
expect(child.size.height, equals(100.0), reason: "child height");
});
@@ -29,7 +29,7 @@ void main() {
pumpFrame();
children.forEach((child) {
children.forEach((RenderBox child) {
expect(child.size.width, equals(50.0), reason: "child width");
expect(child.size.height, equals(50.0), reason: "child height");
});

View File

@@ -19,7 +19,7 @@ void main() {
backgroundColor: const Color(0xFFFF0000)
));
RenderBox stack = new RenderStack(children: [red, green]);
RenderBox stack = new RenderStack(children: <RenderBox>[red, green]);
(green.parentData as StackParentData)
..top = 0.0
..right = 0.0