@@ -76,7 +76,7 @@ void _maybeAddCreationLocationArgument(
7676 }
7777
7878 final NamedExpression namedArgument =
79- new NamedExpression (_creationLocationParameterName, creationLocation);
79+ NamedExpression (_creationLocationParameterName, creationLocation);
8080 namedArgument.parent = arguments;
8181 arguments.named.add (namedArgument);
8282}
@@ -149,26 +149,26 @@ class _WidgetCallSiteTransformer extends Transformer {
149149 Location location, {
150150 String name,
151151 ListLiteral parameterLocations,
152- bool showFile: true ,
152+ bool showFile = true ,
153153 }) {
154154 final List <NamedExpression > arguments = < NamedExpression > [
155- new NamedExpression ('line' , new IntLiteral (location.line)),
156- new NamedExpression ('column' , new IntLiteral (location.column)),
155+ NamedExpression ('line' , IntLiteral (location.line)),
156+ NamedExpression ('column' , IntLiteral (location.column)),
157157 ];
158158 if (showFile) {
159- arguments.add (new NamedExpression (
160- 'file' , new StringLiteral (location.file.toString ())));
159+ arguments.add (NamedExpression (
160+ 'file' , StringLiteral (location.file.toString ())));
161161 }
162162 if (name != null ) {
163- arguments.add (new NamedExpression ('name' , new StringLiteral (name)));
163+ arguments.add (NamedExpression ('name' , StringLiteral (name)));
164164 }
165165 if (parameterLocations != null ) {
166166 arguments
167- .add (new NamedExpression ('parameterLocations' , parameterLocations));
167+ .add (NamedExpression ('parameterLocations' , parameterLocations));
168168 }
169- return new ConstructorInvocation (
169+ return ConstructorInvocation (
170170 _locationClass.constructors.first,
171- new Arguments (< Expression > [], named: arguments),
171+ Arguments (< Expression > [], named: arguments),
172172 isConst: true ,
173173 );
174174 }
@@ -243,7 +243,7 @@ class _WidgetCallSiteTransformer extends Transformer {
243243 _creationLocationParameterName,
244244 );
245245 if (creationLocationParameter != null ) {
246- return new VariableGet (creationLocationParameter);
246+ return VariableGet (creationLocationParameter);
247247 }
248248 }
249249
@@ -270,7 +270,7 @@ class _WidgetCallSiteTransformer extends Transformer {
270270 }
271271 return _constructLocation (
272272 location,
273- parameterLocations: new ListLiteral (
273+ parameterLocations: ListLiteral (
274274 parameterLocations,
275275 typeArgument: _locationClass.thisType,
276276 isConst: true ,
@@ -342,12 +342,12 @@ class WidgetCreatorTracker implements ProgramTransformer {
342342 return ;
343343 }
344344 clazz.implementedTypes
345- .add (new Supertype (_hasCreationLocationClass, < DartType > []));
345+ .add (Supertype (_hasCreationLocationClass, < DartType > []));
346346 // We intentionally use the library context of the _HasCreationLocation
347347 // class for the private field even if [clazz] is in a different library
348348 // so that all classes implementing Widget behave consistently.
349- final Field locationField = new Field (
350- new Name (
349+ final Field locationField = Field (
350+ Name (
351351 _locationFieldName,
352352 _hasCreationLocationClass.enclosingLibrary,
353353 ),
@@ -356,7 +356,7 @@ class WidgetCreatorTracker implements ProgramTransformer {
356356 clazz.addMember (locationField);
357357
358358 final Set <Constructor > _handledConstructors =
359- new Set <Constructor >.identity ();
359+ Set <Constructor >.identity ();
360360
361361 void handleConstructor (Constructor constructor) {
362362 if (! _handledConstructors.add (constructor)) {
@@ -366,7 +366,7 @@ class WidgetCreatorTracker implements ProgramTransformer {
366366 constructor.function,
367367 _creationLocationParameterName,
368368 ));
369- final VariableDeclaration variable = new VariableDeclaration (
369+ final VariableDeclaration variable = VariableDeclaration (
370370 _creationLocationParameterName,
371371 type: _locationClass.thisType,
372372 );
@@ -386,17 +386,17 @@ class WidgetCreatorTracker implements ProgramTransformer {
386386 _maybeAddCreationLocationArgument (
387387 initializer.arguments,
388388 initializer.target.function,
389- new VariableGet (variable),
389+ VariableGet (variable),
390390 _locationClass,
391391 );
392392 hasRedirectingInitializer = true ;
393393 break ;
394394 }
395395 }
396396 if (! hasRedirectingInitializer) {
397- constructor.initializers.add (new FieldInitializer (
397+ constructor.initializers.add (FieldInitializer (
398398 locationField,
399- new VariableGet (variable),
399+ VariableGet (variable),
400400 ));
401401 // TODO(jacobr): add an assert verifying the locationField is not
402402 // null. Currently, we cannot safely add this assert because we do not
@@ -405,9 +405,9 @@ class WidgetCreatorTracker implements ProgramTransformer {
405405 // arguments but it is possible users could add classes with optional
406406 // positional arguments.
407407 //
408- // constructor.initializers.add(new AssertInitializer(new AssertStatement(
409- // new IsExpression(
410- // new VariableGet(variable), _locationClass.thisType),
408+ // constructor.initializers.add(AssertInitializer(AssertStatement(
409+ // IsExpression(
410+ // VariableGet(variable), _locationClass.thisType),
411411 // conditionStartOffset: constructor.fileOffset,
412412 // conditionEndOffset: constructor.fileOffset,
413413 // )));
@@ -434,7 +434,7 @@ class WidgetCreatorTracker implements ProgramTransformer {
434434 }
435435 }
436436 }
437- return new Component ()..libraries.addAll (libraries);
437+ return Component ()..libraries.addAll (libraries);
438438 }
439439
440440 /// Transform the given [program] .
@@ -459,13 +459,13 @@ class WidgetCreatorTracker implements ProgramTransformer {
459459 // TODO(jacobr): once there is a working incremental ClassHierarchy
460460 // constructor switch to using it instead of building a ClassHierarchy off
461461 // the full program.
462- hierarchy = new ClassHierarchy (
462+ hierarchy = ClassHierarchy (
463463 _computeFullProgram (program),
464464 onAmbiguousSupertypes: (Class cls, Supertype a, Supertype b) { },
465465 );
466466
467- final Set <Class > transformedClasses = new Set <Class >.identity ();
468- final Set <Library > librariesToTransform = new Set <Library >.identity ()
467+ final Set <Class > transformedClasses = Set <Class >.identity ();
468+ final Set <Library > librariesToTransform = Set <Library >.identity ()
469469 ..addAll (libraries);
470470
471471 for (Library library in libraries) {
@@ -483,7 +483,7 @@ class WidgetCreatorTracker implements ProgramTransformer {
483483
484484 // Transform call sites to pass the location parameter.
485485 final _WidgetCallSiteTransformer callsiteTransformer =
486- new _WidgetCallSiteTransformer (
486+ _WidgetCallSiteTransformer (
487487 hierarchy,
488488 widgetClass: _widgetClass,
489489 locationClass: _locationClass,
@@ -528,7 +528,7 @@ class WidgetCreatorTracker implements ProgramTransformer {
528528 if (procedure.isFactory) {
529529 _maybeAddNamedParameter (
530530 procedure.function,
531- new VariableDeclaration (
531+ VariableDeclaration (
532532 _creationLocationParameterName,
533533 type: _locationClass.thisType,
534534 ),
@@ -544,14 +544,14 @@ class WidgetCreatorTracker implements ProgramTransformer {
544544 }
545545
546546 final Set <Constructor > _handledConstructors =
547- new Set <Constructor >.identity ();
547+ Set <Constructor >.identity ();
548548
549549 void handleConstructor (Constructor constructor) {
550550 if (! _handledConstructors.add (constructor)) {
551551 return ;
552552 }
553553
554- final VariableDeclaration variable = new VariableDeclaration (
554+ final VariableDeclaration variable = VariableDeclaration (
555555 _creationLocationParameterName,
556556 type: _locationClass.thisType,
557557 );
@@ -575,15 +575,15 @@ class WidgetCreatorTracker implements ProgramTransformer {
575575 _maybeAddCreationLocationArgument (
576576 initializer.arguments,
577577 initializer.target.function,
578- new VariableGet (variable),
578+ VariableGet (variable),
579579 _locationClass,
580580 );
581581 } else if (initializer is SuperInitializer &&
582582 _isSubclassOfWidget (initializer.target.enclosingClass)) {
583583 _maybeAddCreationLocationArgument (
584584 initializer.arguments,
585585 initializer.target.function,
586- new VariableGet (variable),
586+ VariableGet (variable),
587587 _locationClass,
588588 );
589589 }
0 commit comments