unnecessary this in field initializers (#22522)
diff --git a/dev/devicelab/lib/framework/framework.dart b/dev/devicelab/lib/framework/framework.dart index f3583f0..7bc0b64 100644 --- a/dev/devicelab/lib/framework/framework.dart +++ b/dev/devicelab/lib/framework/framework.dart
@@ -148,8 +148,8 @@ class TaskResult { /// Constructs a successful result. TaskResult.success(this.data, {this.benchmarkScoreKeys = const <String>[]}) - : this.succeeded = true, - this.message = 'success' { + : succeeded = true, + message = 'success' { const JsonEncoder prettyJson = JsonEncoder.withIndent(' '); if (benchmarkScoreKeys != null) { for (String key in benchmarkScoreKeys) { @@ -173,9 +173,9 @@ /// Constructs an unsuccessful result. TaskResult.failure(this.message) - : this.succeeded = false, - this.data = null, - this.benchmarkScoreKeys = const <String>[]; + : succeeded = false, + data = null, + benchmarkScoreKeys = const <String>[]; /// Whether the task succeeded. final bool succeeded;
diff --git a/dev/tools/vitool/lib/vitool.dart b/dev/tools/vitool/lib/vitool.dart index 0e1ab4e..e3545d5 100644 --- a/dev/tools/vitool/lib/vitool.dart +++ b/dev/tools/vitool/lib/vitool.dart
@@ -446,7 +446,7 @@ /// Constructs a new _Transform, default arguments create a no-op transform. _Transform({Matrix3 transformMatrix, this.opacity = 1.0}) : - this.transformMatrix = transformMatrix ?? Matrix3.identity(); + transformMatrix = transformMatrix ?? Matrix3.identity(); final Matrix3 transformMatrix; final double opacity;
diff --git a/packages/flutter/lib/src/cupertino/date_picker.dart b/packages/flutter/lib/src/cupertino/date_picker.dart index 6d687b3..818d166 100644 --- a/packages/flutter/lib/src/cupertino/date_picker.dart +++ b/packages/flutter/lib/src/cupertino/date_picker.dart
@@ -172,7 +172,7 @@ this.maximumYear, this.minuteInterval = 1, this.use24hFormat = false, - }) : this.initialDateTime = initialDateTime ?? DateTime.now(), + }) : initialDateTime = initialDateTime ?? DateTime.now(), assert(mode != null), assert(onDateTimeChanged != null), assert(initialDateTime != null),
diff --git a/packages/flutter/lib/src/material/button.dart b/packages/flutter/lib/src/material/button.dart index d3c75d9..7f75ee4 100644 --- a/packages/flutter/lib/src/material/button.dart +++ b/packages/flutter/lib/src/material/button.dart
@@ -49,7 +49,7 @@ this.clipBehavior = Clip.none, MaterialTapTargetSize materialTapTargetSize, this.child, - }) : this.materialTapTargetSize = materialTapTargetSize ?? MaterialTapTargetSize.padded, + }) : materialTapTargetSize = materialTapTargetSize ?? MaterialTapTargetSize.padded, assert(shape != null), assert(elevation != null), assert(highlightElevation != null),
diff --git a/packages/flutter/lib/src/material/expansion_panel.dart b/packages/flutter/lib/src/material/expansion_panel.dart index 01eabb6..933c709 100644 --- a/packages/flutter/lib/src/material/expansion_panel.dart +++ b/packages/flutter/lib/src/material/expansion_panel.dart
@@ -128,7 +128,7 @@ }) : assert(children != null), assert(animationDuration != null), _allowOnlyOnePanelOpen = false, - this.initialOpenPanelValue = null, + initialOpenPanelValue = null, super(key: key); /// Creates a radio expansion panel list widget.
diff --git a/packages/flutter/lib/src/widgets/bottom_navigation_bar_item.dart b/packages/flutter/lib/src/widgets/bottom_navigation_bar_item.dart index bc82034..c7d7436 100644 --- a/packages/flutter/lib/src/widgets/bottom_navigation_bar_item.dart +++ b/packages/flutter/lib/src/widgets/bottom_navigation_bar_item.dart
@@ -27,7 +27,7 @@ @required this.title, Widget activeIcon, this.backgroundColor, - }) : this.activeIcon = activeIcon ?? icon, + }) : activeIcon = activeIcon ?? icon, assert(icon != null), assert(title != null);
diff --git a/packages/flutter/lib/src/widgets/navigator.dart b/packages/flutter/lib/src/widgets/navigator.dart index b418240..48aa6c9 100644 --- a/packages/flutter/lib/src/widgets/navigator.dart +++ b/packages/flutter/lib/src/widgets/navigator.dart
@@ -78,7 +78,7 @@ /// /// If the [settings] are not provided, an empty [RouteSettings] object is /// used instead. - Route({ RouteSettings settings }) : this.settings = settings ?? const RouteSettings(); + Route({ RouteSettings settings }) : settings = settings ?? const RouteSettings(); /// The navigator that the route is in, if any. NavigatorState get navigator => _navigator;
diff --git a/packages/flutter_driver/lib/src/common/find.dart b/packages/flutter_driver/lib/src/common/find.dart index 8610485..b24b569 100644 --- a/packages/flutter_driver/lib/src/common/find.dart +++ b/packages/flutter_driver/lib/src/common/find.dart
@@ -191,8 +191,8 @@ class ByValueKey extends SerializableFinder { /// Creates a finder given the key value. ByValueKey(this.keyValue) - : this.keyValueString = '$keyValue', - this.keyValueType = '${keyValue.runtimeType}' { + : keyValueString = '$keyValue', + keyValueType = '${keyValue.runtimeType}' { if (!_supportedKeyValueTypes.contains(keyValue.runtimeType)) throw _createInvalidKeyValueTypeError('$keyValue.runtimeType'); }
diff --git a/packages/flutter_driver/lib/src/common/frame_sync.dart b/packages/flutter_driver/lib/src/common/frame_sync.dart index 51cf884..114a55a 100644 --- a/packages/flutter_driver/lib/src/common/frame_sync.dart +++ b/packages/flutter_driver/lib/src/common/frame_sync.dart
@@ -11,7 +11,7 @@ /// Deserializes this command from the value generated by [serialize]. SetFrameSync.deserialize(Map<String, String> params) - : this.enabled = params['enabled'].toLowerCase() == 'true', + : enabled = params['enabled'].toLowerCase() == 'true', super.deserialize(params); /// Whether frameSync should be enabled or disabled.
diff --git a/packages/flutter_driver/lib/src/common/gesture.dart b/packages/flutter_driver/lib/src/common/gesture.dart index d1c535a..6da0b1d 100644 --- a/packages/flutter_driver/lib/src/common/gesture.dart +++ b/packages/flutter_driver/lib/src/common/gesture.dart
@@ -44,10 +44,10 @@ /// Deserializes this command from the value generated by [serialize]. Scroll.deserialize(Map<String, String> json) - : this.dx = double.parse(json['dx']), - this.dy = double.parse(json['dy']), - this.duration = Duration(microseconds: int.parse(json['duration'])), - this.frequency = int.parse(json['frequency']), + : dx = double.parse(json['dx']), + dy = double.parse(json['dy']), + duration = Duration(microseconds: int.parse(json['duration'])), + frequency = int.parse(json['frequency']), super.deserialize(json); /// Delta X offset per move event. @@ -94,7 +94,7 @@ /// Deserializes this command from the value generated by [serialize]. ScrollIntoView.deserialize(Map<String, String> json) - : this.alignment = double.parse(json['alignment']), + : alignment = double.parse(json['alignment']), super.deserialize(json); /// How the widget should be aligned.
diff --git a/packages/flutter_driver/lib/src/common/message.dart b/packages/flutter_driver/lib/src/common/message.dart index e834ebf..36aab52 100644 --- a/packages/flutter_driver/lib/src/common/message.dart +++ b/packages/flutter_driver/lib/src/common/message.dart
@@ -10,7 +10,7 @@ /// Abstract const constructor. This constructor enables subclasses to provide /// const constructors so that they can be used in const expressions. const Command({ Duration timeout }) - : this.timeout = timeout ?? const Duration(seconds: 5); + : timeout = timeout ?? const Duration(seconds: 5); /// Deserializes this command from the value generated by [serialize]. Command.deserialize(Map<String, String> json)
diff --git a/packages/flutter_driver/lib/src/common/request_data.dart b/packages/flutter_driver/lib/src/common/request_data.dart index 82026b7..d9b6598 100644 --- a/packages/flutter_driver/lib/src/common/request_data.dart +++ b/packages/flutter_driver/lib/src/common/request_data.dart
@@ -12,7 +12,7 @@ /// Deserializes this command from the value generated by [serialize]. RequestData.deserialize(Map<String, String> params) - : this.message = params['message'], + : message = params['message'], super.deserialize(params); /// The message being sent from the test to the application.
diff --git a/packages/flutter_driver/lib/src/common/semantics.dart b/packages/flutter_driver/lib/src/common/semantics.dart index f015f67..048c3d0 100644 --- a/packages/flutter_driver/lib/src/common/semantics.dart +++ b/packages/flutter_driver/lib/src/common/semantics.dart
@@ -11,7 +11,7 @@ /// Deserializes this command from the value generated by [serialize]. SetSemantics.deserialize(Map<String, String> params) - : this.enabled = params['enabled'].toLowerCase() == 'true', + : enabled = params['enabled'].toLowerCase() == 'true', super.deserialize(params); /// Whether semantics should be enabled (true) or disabled (false).
diff --git a/packages/flutter_driver/lib/src/driver/timeline_summary.dart b/packages/flutter_driver/lib/src/driver/timeline_summary.dart index 64e7dc0..85322c2 100644 --- a/packages/flutter_driver/lib/src/driver/timeline_summary.dart +++ b/packages/flutter_driver/lib/src/driver/timeline_summary.dart
@@ -207,7 +207,7 @@ class TimedEvent { /// Creates a timed event given begin and end timestamps in microseconds. TimedEvent(int beginTimeMicros, int endTimeMicros) - : this.duration = Duration(microseconds: endTimeMicros - beginTimeMicros); + : duration = Duration(microseconds: endTimeMicros - beginTimeMicros); /// The duration of the event. final Duration duration;
diff --git a/packages/flutter_localizations/lib/src/material_localizations.dart b/packages/flutter_localizations/lib/src/material_localizations.dart index 453b944..61debf8 100644 --- a/packages/flutter_localizations/lib/src/material_localizations.dart +++ b/packages/flutter_localizations/lib/src/material_localizations.dart
@@ -100,19 +100,19 @@ @required intl.NumberFormat decimalFormat, @required intl.NumberFormat twoDigitZeroPaddedFormat, }) : assert(localeName != null), - this._localeName = localeName, + _localeName = localeName, assert(fullYearFormat != null), - this._fullYearFormat = fullYearFormat, + _fullYearFormat = fullYearFormat, assert(mediumDateFormat != null), - this._mediumDateFormat = mediumDateFormat, + _mediumDateFormat = mediumDateFormat, assert(longDateFormat != null), - this._longDateFormat = longDateFormat, + _longDateFormat = longDateFormat, assert(yearMonthFormat != null), - this._yearMonthFormat = yearMonthFormat, + _yearMonthFormat = yearMonthFormat, assert(decimalFormat != null), - this._decimalFormat = decimalFormat, + _decimalFormat = decimalFormat, assert(twoDigitZeroPaddedFormat != null), - this._twoDigitZeroPaddedFormat = twoDigitZeroPaddedFormat; + _twoDigitZeroPaddedFormat = twoDigitZeroPaddedFormat; final String _localeName; final intl.DateFormat _fullYearFormat;
diff --git a/packages/flutter_tools/lib/src/android/android_studio.dart b/packages/flutter_tools/lib/src/android/android_studio.dart index 4c3dc98..932433b 100644 --- a/packages/flutter_tools/lib/src/android/android_studio.dart +++ b/packages/flutter_tools/lib/src/android/android_studio.dart
@@ -32,7 +32,7 @@ class AndroidStudio implements Comparable<AndroidStudio> { AndroidStudio(this.directory, {Version version, this.configured, this.studioAppName = 'AndroidStudio'}) - : this.version = version ?? Version.unknown { + : version = version ?? Version.unknown { _init(); }
diff --git a/packages/flutter_tools/lib/src/resident_runner.dart b/packages/flutter_tools/lib/src/resident_runner.dart index 73cee56..53cd22c 100644 --- a/packages/flutter_tools/lib/src/resident_runner.dart +++ b/packages/flutter_tools/lib/src/resident_runner.dart
@@ -35,7 +35,7 @@ this.fileSystemRoots, this.fileSystemScheme, ResidentCompiler generator, - }) : this.generator = generator ?? ResidentCompiler( + }) : generator = generator ?? ResidentCompiler( artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath), trackWidgetCreation: trackWidgetCreation, fileSystemRoots: fileSystemRoots, fileSystemScheme: fileSystemScheme
diff --git a/packages/flutter_tools/lib/src/test/event_printer.dart b/packages/flutter_tools/lib/src/test/event_printer.dart index a19f566..ab2648f 100644 --- a/packages/flutter_tools/lib/src/test/event_printer.dart +++ b/packages/flutter_tools/lib/src/test/event_printer.dart
@@ -9,7 +9,7 @@ /// Prints JSON events when running a test in --machine mode. class EventPrinter extends TestWatcher { - EventPrinter({StringSink out}) : this._out = out == null ? stdout: out; + EventPrinter({StringSink out}) : _out = out == null ? stdout: out; final StringSink _out;
diff --git a/packages/flutter_tools/lib/src/vscode/vscode.dart b/packages/flutter_tools/lib/src/vscode/vscode.dart index 3ea9a3f..e92b9e3 100644 --- a/packages/flutter_tools/lib/src/vscode/vscode.dart +++ b/packages/flutter_tools/lib/src/vscode/vscode.dart
@@ -14,7 +14,7 @@ class VsCode { VsCode._(this.directory, this.extensionDirectory, { Version version, this.edition }) - : this.version = version ?? Version.unknown { + : version = version ?? Version.unknown { if (!fs.isDirectorySync(directory)) { _validationMessages.add('VS Code not found at $directory'); @@ -195,7 +195,7 @@ class _VsCodeInstallLocation { const _VsCodeInstallLocation(this.installPath, this.extensionsFolder, { this.edition, bool isInsiders }) - : this.isInsiders = isInsiders ?? false; + : isInsiders = isInsiders ?? false; final String installPath; final String extensionsFolder; final String edition;
diff --git a/packages/flutter_tools/test/integration/test_driver.dart b/packages/flutter_tools/test/integration/test_driver.dart index b8503a2..d4a94e8 100644 --- a/packages/flutter_tools/test/integration/test_driver.dart +++ b/packages/flutter_tools/test/integration/test_driver.dart
@@ -24,7 +24,7 @@ class FlutterTestDriver { FlutterTestDriver(this._projectFolder, {String logPrefix}): - this._logPrefix = logPrefix != null ? '$logPrefix: ' : ''; + _logPrefix = logPrefix != null ? '$logPrefix: ' : ''; final Directory _projectFolder; final String _logPrefix;
diff --git a/packages/fuchsia_remote_debug_protocol/lib/src/common/logging.dart b/packages/fuchsia_remote_debug_protocol/lib/src/common/logging.dart index d015c71..8a1e666 100644 --- a/packages/fuchsia_remote_debug_protocol/lib/src/common/logging.dart +++ b/packages/fuchsia_remote_debug_protocol/lib/src/common/logging.dart
@@ -69,9 +69,9 @@ /// /// When this message is created, it sets its [time] to [DateTime.now]. LogMessage(this.message, this.tag, this.level) - : this.levelName = + : levelName = level.toString().substring(level.toString().indexOf('.') + 1), - this.time = DateTime.now(); + time = DateTime.now(); /// The actual log message. final String message;