prefer_initializing_formals (#8797)

This commit is contained in:
Alexandre Ardhuin
2017-03-15 18:30:55 +01:00
committed by GitHub
parent f8238185cc
commit a9ba0e2f88
27 changed files with 66 additions and 97 deletions

View File

@@ -161,9 +161,8 @@ class ByValueKey extends SerializableFinder {
final String finderType = 'ByValueKey';
/// Creates a finder given the key value.
ByValueKey(dynamic keyValue)
: this.keyValue = keyValue,
this.keyValueString = '$keyValue',
ByValueKey(this.keyValue)
: this.keyValueString = '$keyValue',
this.keyValueType = '${keyValue.runtimeType}' {
if (!_supportedKeyValueTypes.contains(keyValue.runtimeType))
throw _createInvalidKeyValueTypeError('$keyValue.runtimeType');

View File

@@ -22,9 +22,8 @@ class MatchResult {
: hasMatched = true,
mismatchDescription = null;
MatchResult._mismatched(String mismatchDescription)
: hasMatched = false,
mismatchDescription = mismatchDescription;
MatchResult._mismatched(this.mismatchDescription)
: hasMatched = false;
/// Whether the match succeeded.
final bool hasMatched;

View File

@@ -184,8 +184,6 @@ class TimedEvent {
final Duration duration;
/// Creates a timed event given begin and end timestamps in microseconds.
TimedEvent(int beginTimeMicros, int endTimeMicros)
: this.beginTimeMicros = beginTimeMicros,
this.endTimeMicros = endTimeMicros,
this.duration = new Duration(microseconds: endTimeMicros - beginTimeMicros);
TimedEvent(this.beginTimeMicros, this.endTimeMicros)
: this.duration = new Duration(microseconds: endTimeMicros - beginTimeMicros);
}