Enable and fix lint unnecessary_this (#314)
diff --git a/analysis_options.yaml b/analysis_options.yaml
index 543ea34..54ab5cf 100644
--- a/analysis_options.yaml
+++ b/analysis_options.yaml
@@ -72,7 +72,7 @@
- unnecessary_overrides
- unnecessary_parenthesis
- unnecessary_statements
- # unnecessary_this
+ - unnecessary_this
- unrelated_type_equality_checks
- use_rethrow_when_possible
- valid_regexps
diff --git a/lib/src/multipart_file.dart b/lib/src/multipart_file.dart
index 4f23c78..c063939 100644
--- a/lib/src/multipart_file.dart
+++ b/lib/src/multipart_file.dart
@@ -45,9 +45,8 @@
/// future may be inferred from [filename].
MultipartFile(this.field, Stream<List<int>> stream, this.length,
{this.filename, MediaType contentType})
- : this._stream = toByteStream(stream),
- this.contentType =
- contentType ?? MediaType('application', 'octet-stream');
+ : _stream = toByteStream(stream),
+ contentType = contentType ?? MediaType('application', 'octet-stream');
/// Creates a new [MultipartFile] from a byte array.
///
diff --git a/lib/src/request.dart b/lib/src/request.dart
index e3cff97..0c6910d 100644
--- a/lib/src/request.dart
+++ b/lib/src/request.dart
@@ -127,7 +127,7 @@
'content-type "${contentType.mimeType}".');
}
- this.body = mapToQuery(fields, encoding: encoding);
+ body = mapToQuery(fields, encoding: encoding);
}
/// Creates a new HTTP request.
diff --git a/lib/src/streamed_response.dart b/lib/src/streamed_response.dart
index 29ab1b0..fc10470 100644
--- a/lib/src/streamed_response.dart
+++ b/lib/src/streamed_response.dart
@@ -25,7 +25,7 @@
bool isRedirect = false,
bool persistentConnection = true,
String reasonPhrase})
- : this.stream = toByteStream(stream),
+ : stream = toByteStream(stream),
super(statusCode,
contentLength: contentLength,
request: request,