Skip to content

Commit 180c77a

Browse files
authored
Make a private final field with getter public (#356)
1 parent 01b325b commit 180c77a

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.12.0+4-dev
2+
3+
* Internal changes.
4+
15
## 0.12.0+3
26

37
* Documentation fixes.

lib/src/multipart_request.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,11 @@ class MultipartRequest extends BaseRequest {
4343
/// The form fields to send for this request.
4444
final fields = <String, String>{};
4545

46-
final _files = <MultipartFile>[];
46+
/// The list of files to upload for this request.
47+
final files = <MultipartFile>[];
4748

4849
MultipartRequest(String method, Uri url) : super(method, url);
4950

50-
/// The list of files to upload for this request.
51-
List<MultipartFile> get files => _files;
52-
5351
/// The total length of the request body, in bytes.
5452
///
5553
/// This is calculated from [fields] and [files] and cannot be set manually.
@@ -66,7 +64,7 @@ class MultipartRequest extends BaseRequest {
6664
'\r\n'.length;
6765
});
6866

69-
for (var file in _files) {
67+
for (var file in files) {
7068
length += '--'.length +
7169
_boundaryLength +
7270
'\r\n'.length +
@@ -105,7 +103,7 @@ class MultipartRequest extends BaseRequest {
105103
yield line;
106104
}
107105

108-
for (final file in _files) {
106+
for (final file in files) {
109107
yield separator;
110108
yield utf8.encode(_headerForFile(file));
111109
yield* file.finalize();

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: http
2-
version: 0.12.0+3
2+
version: 0.12.0+4-dev
33
homepage: https://github.com/dart-lang/http
44
description: A composable, multi-platform, Future-based API for HTTP requests.
55

0 commit comments

Comments
 (0)