unnecessary this in field initializers (#22522)
This commit is contained in:
parent
4bd6ad7395
commit
5de96bb734
@ -148,8 +148,8 @@ class _TaskRunner {
|
|||||||
class TaskResult {
|
class TaskResult {
|
||||||
/// Constructs a successful result.
|
/// Constructs a successful result.
|
||||||
TaskResult.success(this.data, {this.benchmarkScoreKeys = const <String>[]})
|
TaskResult.success(this.data, {this.benchmarkScoreKeys = const <String>[]})
|
||||||
: this.succeeded = true,
|
: succeeded = true,
|
||||||
this.message = 'success' {
|
message = 'success' {
|
||||||
const JsonEncoder prettyJson = JsonEncoder.withIndent(' ');
|
const JsonEncoder prettyJson = JsonEncoder.withIndent(' ');
|
||||||
if (benchmarkScoreKeys != null) {
|
if (benchmarkScoreKeys != null) {
|
||||||
for (String key in benchmarkScoreKeys) {
|
for (String key in benchmarkScoreKeys) {
|
||||||
@ -173,9 +173,9 @@ class TaskResult {
|
|||||||
|
|
||||||
/// Constructs an unsuccessful result.
|
/// Constructs an unsuccessful result.
|
||||||
TaskResult.failure(this.message)
|
TaskResult.failure(this.message)
|
||||||
: this.succeeded = false,
|
: succeeded = false,
|
||||||
this.data = null,
|
data = null,
|
||||||
this.benchmarkScoreKeys = const <String>[];
|
benchmarkScoreKeys = const <String>[];
|
||||||
|
|
||||||
/// Whether the task succeeded.
|
/// Whether the task succeeded.
|
||||||
final bool succeeded;
|
final bool succeeded;
|
||||||
|
@ -446,7 +446,7 @@ class _Transform {
|
|||||||
|
|
||||||
/// Constructs a new _Transform, default arguments create a no-op transform.
|
/// Constructs a new _Transform, default arguments create a no-op transform.
|
||||||
_Transform({Matrix3 transformMatrix, this.opacity = 1.0}) :
|
_Transform({Matrix3 transformMatrix, this.opacity = 1.0}) :
|
||||||
this.transformMatrix = transformMatrix ?? Matrix3.identity();
|
transformMatrix = transformMatrix ?? Matrix3.identity();
|
||||||
|
|
||||||
final Matrix3 transformMatrix;
|
final Matrix3 transformMatrix;
|
||||||
final double opacity;
|
final double opacity;
|
||||||
|
@ -172,7 +172,7 @@ class CupertinoDatePicker extends StatefulWidget {
|
|||||||
this.maximumYear,
|
this.maximumYear,
|
||||||
this.minuteInterval = 1,
|
this.minuteInterval = 1,
|
||||||
this.use24hFormat = false,
|
this.use24hFormat = false,
|
||||||
}) : this.initialDateTime = initialDateTime ?? DateTime.now(),
|
}) : initialDateTime = initialDateTime ?? DateTime.now(),
|
||||||
assert(mode != null),
|
assert(mode != null),
|
||||||
assert(onDateTimeChanged != null),
|
assert(onDateTimeChanged != null),
|
||||||
assert(initialDateTime != null),
|
assert(initialDateTime != null),
|
||||||
|
@ -49,7 +49,7 @@ class RawMaterialButton extends StatefulWidget {
|
|||||||
this.clipBehavior = Clip.none,
|
this.clipBehavior = Clip.none,
|
||||||
MaterialTapTargetSize materialTapTargetSize,
|
MaterialTapTargetSize materialTapTargetSize,
|
||||||
this.child,
|
this.child,
|
||||||
}) : this.materialTapTargetSize = materialTapTargetSize ?? MaterialTapTargetSize.padded,
|
}) : materialTapTargetSize = materialTapTargetSize ?? MaterialTapTargetSize.padded,
|
||||||
assert(shape != null),
|
assert(shape != null),
|
||||||
assert(elevation != null),
|
assert(elevation != null),
|
||||||
assert(highlightElevation != null),
|
assert(highlightElevation != null),
|
||||||
|
@ -128,7 +128,7 @@ class ExpansionPanelList extends StatefulWidget {
|
|||||||
}) : assert(children != null),
|
}) : assert(children != null),
|
||||||
assert(animationDuration != null),
|
assert(animationDuration != null),
|
||||||
_allowOnlyOnePanelOpen = false,
|
_allowOnlyOnePanelOpen = false,
|
||||||
this.initialOpenPanelValue = null,
|
initialOpenPanelValue = null,
|
||||||
super(key: key);
|
super(key: key);
|
||||||
|
|
||||||
/// Creates a radio expansion panel list widget.
|
/// Creates a radio expansion panel list widget.
|
||||||
|
@ -27,7 +27,7 @@ class BottomNavigationBarItem {
|
|||||||
@required this.title,
|
@required this.title,
|
||||||
Widget activeIcon,
|
Widget activeIcon,
|
||||||
this.backgroundColor,
|
this.backgroundColor,
|
||||||
}) : this.activeIcon = activeIcon ?? icon,
|
}) : activeIcon = activeIcon ?? icon,
|
||||||
assert(icon != null),
|
assert(icon != null),
|
||||||
assert(title != null);
|
assert(title != null);
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ abstract class Route<T> {
|
|||||||
///
|
///
|
||||||
/// If the [settings] are not provided, an empty [RouteSettings] object is
|
/// If the [settings] are not provided, an empty [RouteSettings] object is
|
||||||
/// used instead.
|
/// 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.
|
/// The navigator that the route is in, if any.
|
||||||
NavigatorState get navigator => _navigator;
|
NavigatorState get navigator => _navigator;
|
||||||
|
@ -191,8 +191,8 @@ class ByText extends SerializableFinder {
|
|||||||
class ByValueKey extends SerializableFinder {
|
class ByValueKey extends SerializableFinder {
|
||||||
/// Creates a finder given the key value.
|
/// Creates a finder given the key value.
|
||||||
ByValueKey(this.keyValue)
|
ByValueKey(this.keyValue)
|
||||||
: this.keyValueString = '$keyValue',
|
: keyValueString = '$keyValue',
|
||||||
this.keyValueType = '${keyValue.runtimeType}' {
|
keyValueType = '${keyValue.runtimeType}' {
|
||||||
if (!_supportedKeyValueTypes.contains(keyValue.runtimeType))
|
if (!_supportedKeyValueTypes.contains(keyValue.runtimeType))
|
||||||
throw _createInvalidKeyValueTypeError('$keyValue.runtimeType');
|
throw _createInvalidKeyValueTypeError('$keyValue.runtimeType');
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ class SetFrameSync extends Command {
|
|||||||
|
|
||||||
/// Deserializes this command from the value generated by [serialize].
|
/// Deserializes this command from the value generated by [serialize].
|
||||||
SetFrameSync.deserialize(Map<String, String> params)
|
SetFrameSync.deserialize(Map<String, String> params)
|
||||||
: this.enabled = params['enabled'].toLowerCase() == 'true',
|
: enabled = params['enabled'].toLowerCase() == 'true',
|
||||||
super.deserialize(params);
|
super.deserialize(params);
|
||||||
|
|
||||||
/// Whether frameSync should be enabled or disabled.
|
/// Whether frameSync should be enabled or disabled.
|
||||||
|
@ -44,10 +44,10 @@ class Scroll extends CommandWithTarget {
|
|||||||
|
|
||||||
/// Deserializes this command from the value generated by [serialize].
|
/// Deserializes this command from the value generated by [serialize].
|
||||||
Scroll.deserialize(Map<String, String> json)
|
Scroll.deserialize(Map<String, String> json)
|
||||||
: this.dx = double.parse(json['dx']),
|
: dx = double.parse(json['dx']),
|
||||||
this.dy = double.parse(json['dy']),
|
dy = double.parse(json['dy']),
|
||||||
this.duration = Duration(microseconds: int.parse(json['duration'])),
|
duration = Duration(microseconds: int.parse(json['duration'])),
|
||||||
this.frequency = int.parse(json['frequency']),
|
frequency = int.parse(json['frequency']),
|
||||||
super.deserialize(json);
|
super.deserialize(json);
|
||||||
|
|
||||||
/// Delta X offset per move event.
|
/// Delta X offset per move event.
|
||||||
@ -94,7 +94,7 @@ class ScrollIntoView extends CommandWithTarget {
|
|||||||
|
|
||||||
/// Deserializes this command from the value generated by [serialize].
|
/// Deserializes this command from the value generated by [serialize].
|
||||||
ScrollIntoView.deserialize(Map<String, String> json)
|
ScrollIntoView.deserialize(Map<String, String> json)
|
||||||
: this.alignment = double.parse(json['alignment']),
|
: alignment = double.parse(json['alignment']),
|
||||||
super.deserialize(json);
|
super.deserialize(json);
|
||||||
|
|
||||||
/// How the widget should be aligned.
|
/// How the widget should be aligned.
|
||||||
|
@ -10,7 +10,7 @@ abstract class Command {
|
|||||||
/// Abstract const constructor. This constructor enables subclasses to provide
|
/// Abstract const constructor. This constructor enables subclasses to provide
|
||||||
/// const constructors so that they can be used in const expressions.
|
/// const constructors so that they can be used in const expressions.
|
||||||
const Command({ Duration timeout })
|
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].
|
/// Deserializes this command from the value generated by [serialize].
|
||||||
Command.deserialize(Map<String, String> json)
|
Command.deserialize(Map<String, String> json)
|
||||||
|
@ -12,7 +12,7 @@ class RequestData extends Command {
|
|||||||
|
|
||||||
/// Deserializes this command from the value generated by [serialize].
|
/// Deserializes this command from the value generated by [serialize].
|
||||||
RequestData.deserialize(Map<String, String> params)
|
RequestData.deserialize(Map<String, String> params)
|
||||||
: this.message = params['message'],
|
: message = params['message'],
|
||||||
super.deserialize(params);
|
super.deserialize(params);
|
||||||
|
|
||||||
/// The message being sent from the test to the application.
|
/// The message being sent from the test to the application.
|
||||||
|
@ -11,7 +11,7 @@ class SetSemantics extends Command {
|
|||||||
|
|
||||||
/// Deserializes this command from the value generated by [serialize].
|
/// Deserializes this command from the value generated by [serialize].
|
||||||
SetSemantics.deserialize(Map<String, String> params)
|
SetSemantics.deserialize(Map<String, String> params)
|
||||||
: this.enabled = params['enabled'].toLowerCase() == 'true',
|
: enabled = params['enabled'].toLowerCase() == 'true',
|
||||||
super.deserialize(params);
|
super.deserialize(params);
|
||||||
|
|
||||||
/// Whether semantics should be enabled (true) or disabled (false).
|
/// Whether semantics should be enabled (true) or disabled (false).
|
||||||
|
@ -207,7 +207,7 @@ class TimelineSummary {
|
|||||||
class TimedEvent {
|
class TimedEvent {
|
||||||
/// Creates a timed event given begin and end timestamps in microseconds.
|
/// Creates a timed event given begin and end timestamps in microseconds.
|
||||||
TimedEvent(int beginTimeMicros, int endTimeMicros)
|
TimedEvent(int beginTimeMicros, int endTimeMicros)
|
||||||
: this.duration = Duration(microseconds: endTimeMicros - beginTimeMicros);
|
: duration = Duration(microseconds: endTimeMicros - beginTimeMicros);
|
||||||
|
|
||||||
/// The duration of the event.
|
/// The duration of the event.
|
||||||
final Duration duration;
|
final Duration duration;
|
||||||
|
@ -100,19 +100,19 @@ abstract class GlobalMaterialLocalizations implements MaterialLocalizations {
|
|||||||
@required intl.NumberFormat decimalFormat,
|
@required intl.NumberFormat decimalFormat,
|
||||||
@required intl.NumberFormat twoDigitZeroPaddedFormat,
|
@required intl.NumberFormat twoDigitZeroPaddedFormat,
|
||||||
}) : assert(localeName != null),
|
}) : assert(localeName != null),
|
||||||
this._localeName = localeName,
|
_localeName = localeName,
|
||||||
assert(fullYearFormat != null),
|
assert(fullYearFormat != null),
|
||||||
this._fullYearFormat = fullYearFormat,
|
_fullYearFormat = fullYearFormat,
|
||||||
assert(mediumDateFormat != null),
|
assert(mediumDateFormat != null),
|
||||||
this._mediumDateFormat = mediumDateFormat,
|
_mediumDateFormat = mediumDateFormat,
|
||||||
assert(longDateFormat != null),
|
assert(longDateFormat != null),
|
||||||
this._longDateFormat = longDateFormat,
|
_longDateFormat = longDateFormat,
|
||||||
assert(yearMonthFormat != null),
|
assert(yearMonthFormat != null),
|
||||||
this._yearMonthFormat = yearMonthFormat,
|
_yearMonthFormat = yearMonthFormat,
|
||||||
assert(decimalFormat != null),
|
assert(decimalFormat != null),
|
||||||
this._decimalFormat = decimalFormat,
|
_decimalFormat = decimalFormat,
|
||||||
assert(twoDigitZeroPaddedFormat != null),
|
assert(twoDigitZeroPaddedFormat != null),
|
||||||
this._twoDigitZeroPaddedFormat = twoDigitZeroPaddedFormat;
|
_twoDigitZeroPaddedFormat = twoDigitZeroPaddedFormat;
|
||||||
|
|
||||||
final String _localeName;
|
final String _localeName;
|
||||||
final intl.DateFormat _fullYearFormat;
|
final intl.DateFormat _fullYearFormat;
|
||||||
|
@ -32,7 +32,7 @@ String get javaPath => androidStudio?.javaPath;
|
|||||||
class AndroidStudio implements Comparable<AndroidStudio> {
|
class AndroidStudio implements Comparable<AndroidStudio> {
|
||||||
AndroidStudio(this.directory,
|
AndroidStudio(this.directory,
|
||||||
{Version version, this.configured, this.studioAppName = 'AndroidStudio'})
|
{Version version, this.configured, this.studioAppName = 'AndroidStudio'})
|
||||||
: this.version = version ?? Version.unknown {
|
: version = version ?? Version.unknown {
|
||||||
_init();
|
_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ class FlutterDevice {
|
|||||||
this.fileSystemRoots,
|
this.fileSystemRoots,
|
||||||
this.fileSystemScheme,
|
this.fileSystemScheme,
|
||||||
ResidentCompiler generator,
|
ResidentCompiler generator,
|
||||||
}) : this.generator = generator ?? ResidentCompiler(
|
}) : generator = generator ?? ResidentCompiler(
|
||||||
artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath),
|
artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath),
|
||||||
trackWidgetCreation: trackWidgetCreation,
|
trackWidgetCreation: trackWidgetCreation,
|
||||||
fileSystemRoots: fileSystemRoots, fileSystemScheme: fileSystemScheme
|
fileSystemRoots: fileSystemRoots, fileSystemScheme: fileSystemScheme
|
||||||
|
@ -9,7 +9,7 @@ import 'watcher.dart';
|
|||||||
|
|
||||||
/// Prints JSON events when running a test in --machine mode.
|
/// Prints JSON events when running a test in --machine mode.
|
||||||
class EventPrinter extends TestWatcher {
|
class EventPrinter extends TestWatcher {
|
||||||
EventPrinter({StringSink out}) : this._out = out == null ? stdout: out;
|
EventPrinter({StringSink out}) : _out = out == null ? stdout: out;
|
||||||
|
|
||||||
final StringSink _out;
|
final StringSink _out;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ const bool _includeInsiders = false;
|
|||||||
|
|
||||||
class VsCode {
|
class VsCode {
|
||||||
VsCode._(this.directory, this.extensionDirectory, { Version version, this.edition })
|
VsCode._(this.directory, this.extensionDirectory, { Version version, this.edition })
|
||||||
: this.version = version ?? Version.unknown {
|
: version = version ?? Version.unknown {
|
||||||
|
|
||||||
if (!fs.isDirectorySync(directory)) {
|
if (!fs.isDirectorySync(directory)) {
|
||||||
_validationMessages.add('VS Code not found at $directory');
|
_validationMessages.add('VS Code not found at $directory');
|
||||||
@ -195,7 +195,7 @@ class VsCode {
|
|||||||
|
|
||||||
class _VsCodeInstallLocation {
|
class _VsCodeInstallLocation {
|
||||||
const _VsCodeInstallLocation(this.installPath, this.extensionsFolder, { this.edition, bool isInsiders })
|
const _VsCodeInstallLocation(this.installPath, this.extensionsFolder, { this.edition, bool isInsiders })
|
||||||
: this.isInsiders = isInsiders ?? false;
|
: isInsiders = isInsiders ?? false;
|
||||||
final String installPath;
|
final String installPath;
|
||||||
final String extensionsFolder;
|
final String extensionsFolder;
|
||||||
final String edition;
|
final String edition;
|
||||||
|
@ -24,7 +24,7 @@ const Duration quitTimeout = Duration(seconds: 10);
|
|||||||
|
|
||||||
class FlutterTestDriver {
|
class FlutterTestDriver {
|
||||||
FlutterTestDriver(this._projectFolder, {String logPrefix}):
|
FlutterTestDriver(this._projectFolder, {String logPrefix}):
|
||||||
this._logPrefix = logPrefix != null ? '$logPrefix: ' : '';
|
_logPrefix = logPrefix != null ? '$logPrefix: ' : '';
|
||||||
|
|
||||||
final Directory _projectFolder;
|
final Directory _projectFolder;
|
||||||
final String _logPrefix;
|
final String _logPrefix;
|
||||||
|
@ -69,9 +69,9 @@ class LogMessage {
|
|||||||
///
|
///
|
||||||
/// When this message is created, it sets its [time] to [DateTime.now].
|
/// When this message is created, it sets its [time] to [DateTime.now].
|
||||||
LogMessage(this.message, this.tag, this.level)
|
LogMessage(this.message, this.tag, this.level)
|
||||||
: this.levelName =
|
: levelName =
|
||||||
level.toString().substring(level.toString().indexOf('.') + 1),
|
level.toString().substring(level.toString().indexOf('.') + 1),
|
||||||
this.time = DateTime.now();
|
time = DateTime.now();
|
||||||
|
|
||||||
/// The actual log message.
|
/// The actual log message.
|
||||||
final String message;
|
final String message;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user