Literals get type annotations.

As per the recent fix to the `always_specify_types` lint (https://github.com/dart-lang/linter/issues/199), literal maps and lists are now expected to be explicitly typed.

Running that lint on the repo identifies quite a few spots to update.  This focuses on `flutter_driver` and `flutter_sprites` (somewhat arbitrarily) but the changes are fairly representative.

Note there are a number of places where I made a quick judgement on how specific to make the types.  Feedback on those is welcome.  (Especially as we move forward with more.)
This commit is contained in:
pq
2016-05-04 09:18:31 -07:00
parent 1e093701b7
commit bcede8dffb
11 changed files with 54 additions and 54 deletions

View File

@@ -158,7 +158,7 @@ void main() {
ActionTween tween0 = new ActionTween((double a) => value0 = a, 0.0, 1.0, 10.0);
ActionTween tween1 = new ActionTween((double a) => value1 = a, 0.0, 1.0, 20.0);
ActionGroup group = new ActionGroup([tween0, tween1]);
ActionGroup group = new ActionGroup(<ActionTween>[tween0, tween1]);
expect(group.duration, closeTo(20.0, epsilon));
group.update(0.0);
@@ -180,7 +180,7 @@ void main() {
ActionTween tween0 = new ActionTween((double a) => doubleValue = a, 0.0, 1.0, 4.0);
ActionTween tween1 = new ActionTween((double a) => doubleValue = a, 1.0, 0.0, 12.0);
ActionSequence sequence = new ActionSequence([tween0, tween1]);
ActionSequence sequence = new ActionSequence(<ActionTween>[tween0, tween1]);
expect(sequence.duration, closeTo(16.0, epsilon));
sequence.update(0.0);

View File

@@ -19,7 +19,7 @@ void main() {
parent.addChild(node0);
parent.addChild(node1);
node1.constraints = [(new ConstraintPositionToNode(node0))];
node1.constraints = <Constraint>[(new ConstraintPositionToNode(node0))];
node0.position = const Point(100.0, 50.0);
node1.applyConstraints(0.1);
@@ -37,7 +37,7 @@ void main() {
parent.addChild(node0);
parent.addChild(node1);
node1.constraints = [(new ConstraintRotationToNode(node0))];
node1.constraints = <Constraint>[(new ConstraintRotationToNode(node0))];
node1.applyConstraints(0.1);
@@ -53,7 +53,7 @@ void main() {
parent.addChild(node0);
parent.addChild(node1);
node1.constraints = [(new ConstraintRotationToNodeRotation(node0, baseRotation: 10.0))];
node1.constraints = <Constraint>[(new ConstraintRotationToNodeRotation(node0, baseRotation: 10.0))];
node0.rotation = 90.0;
node1.applyConstraints(0.1);
@@ -69,7 +69,7 @@ void main() {
parent.addChild(node0);
Constraint constraint = new ConstraintRotationToMovement();
node0.constraints = [constraint];
node0.constraints = <Constraint>[constraint];
node0.position = const Point(0.0, 0.0);
constraint.preUpdate(node0, 0.1);