Skip to content

Commit 13c40fd

Browse files
authored
Enable and fix lint unnecessary_this (#314)
1 parent e3351b3 commit 13c40fd

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

analysis_options.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ linter:
7272
- unnecessary_overrides
7373
- unnecessary_parenthesis
7474
- unnecessary_statements
75-
# unnecessary_this
75+
- unnecessary_this
7676
- unrelated_type_equality_checks
7777
- use_rethrow_when_possible
7878
- valid_regexps

lib/src/multipart_file.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ class MultipartFile {
4545
/// future may be inferred from [filename].
4646
MultipartFile(this.field, Stream<List<int>> stream, this.length,
4747
{this.filename, MediaType contentType})
48-
: this._stream = toByteStream(stream),
49-
this.contentType =
50-
contentType ?? MediaType('application', 'octet-stream');
48+
: _stream = toByteStream(stream),
49+
contentType = contentType ?? MediaType('application', 'octet-stream');
5150

5251
/// Creates a new [MultipartFile] from a byte array.
5352
///

lib/src/request.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class Request extends BaseRequest {
127127
'content-type "${contentType.mimeType}".');
128128
}
129129

130-
this.body = mapToQuery(fields, encoding: encoding);
130+
body = mapToQuery(fields, encoding: encoding);
131131
}
132132

133133
/// Creates a new HTTP request.

lib/src/streamed_response.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class StreamedResponse extends BaseResponse {
2525
bool isRedirect = false,
2626
bool persistentConnection = true,
2727
String reasonPhrase})
28-
: this.stream = toByteStream(stream),
28+
: stream = toByteStream(stream),
2929
super(statusCode,
3030
contentLength: contentLength,
3131
request: request,

0 commit comments

Comments
 (0)