unnecessary this in field initializers (#22522)

This commit is contained in:
Alexandre Ardhuin
2018-10-02 17:14:59 +02:00
committed by GitHub
parent 4bd6ad7395
commit 5de96bb734
21 changed files with 38 additions and 38 deletions

View File

@@ -191,8 +191,8 @@ class ByText extends SerializableFinder {
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');
}

View File

@@ -11,7 +11,7 @@ class SetFrameSync extends Command {
/// 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.

View File

@@ -44,10 +44,10 @@ class Scroll extends CommandWithTarget {
/// 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 @@ class ScrollIntoView extends CommandWithTarget {
/// 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.

View File

@@ -10,7 +10,7 @@ abstract class Command {
/// 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)

View File

@@ -12,7 +12,7 @@ class RequestData extends Command {
/// 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.

View File

@@ -11,7 +11,7 @@ class SetSemantics extends Command {
/// 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).

View File

@@ -207,7 +207,7 @@ class TimelineSummary {
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;