Index: pkg/http/lib/src/multipart_request.dart |
diff --git a/pkg/http/lib/src/multipart_request.dart b/pkg/http/lib/src/multipart_request.dart |
index bc588713cf61d0bd2c4b4654e675bb5da6bbb583..bebc552fd3bfdf165b23b94cc9a9856e3b67a0d7 100644 |
--- a/pkg/http/lib/src/multipart_request.dart |
+++ b/pkg/http/lib/src/multipart_request.dart |
@@ -52,7 +52,7 @@ class MultipartRequest extends BaseRequest { |
encodeUtf8(value).length + "\r\n".length; |
}); |
- for (var file in _files.collection) { |
+ for (var file in _files) { |
length += "--".length + _BOUNDARY_LENGTH + "\r\n".length + |
_headerForFile(file).length + |
file.length + "\r\n".length; |
@@ -73,17 +73,16 @@ class MultipartRequest extends BaseRequest { |
/// |
/// This doesn't need to be closed. When the request is sent, whichever files |
/// are written to this sink at that point will be used. |
- CollectionSink<MultipartFile> get files => _files; |
+ List<MultipartFile> get files => _files; |
- /// The private version of [files], typed so that the underlying collection is |
- /// accessible. |
- final CollectionSink<MultipartFile> _files; |
+ /// The private version of [files]. |
+ final List<MultipartFile> _files; |
/// Creates a new [MultipartRequest]. |
MultipartRequest(String method, Uri url) |
: super(method, url), |
fields = {}, |
- _files = new CollectionSink<MultipartFile>(<MultipartFile>[]); |
+ _files = <MultipartFile>[]; |
/// Freezes all mutable fields and returns a single-subscription [ByteStream] |
/// that will emit the request body. |
@@ -111,7 +110,7 @@ class MultipartRequest extends BaseRequest { |
writeLine(); |
}); |
- Future.forEach(_files.collection, (file) { |
+ Future.forEach(_files, (file) { |
writeAscii('--$boundary\r\n'); |
writeAscii(_headerForFile(file)); |
return writeStreamToSink(file.finalize(), controller) |