Skip to content

Commit 6a904a4

Browse files
committed
function type used instead typedef OnUploadProgress
1 parent 51345e4 commit 6a904a4

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

pkgs/http/lib/src/base_request.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ abstract class BaseRequest {
113113
/// lengthComputable :
114114
/// library.html : xhr.lengthComputable
115115
/// library.io : content-length is provided (MultipartRequest provide)
116-
final OnUploadProgress? onUploadProgress;
116+
final void Function(int uploaded, int total)? onUploadProgress;
117117

118118
BaseRequest(String method, this.url, {this.onUploadProgress})
119119
: method = _validateMethod(method),

pkgs/http/lib/src/multipart_request.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ class MultipartRequest extends BaseRequest {
5151
/// lengthComputable :
5252
/// library.html : xhr.lengthComputable
5353
/// library.io : content-length is provided (MultipartRequest provide)
54-
MultipartRequest(String method, Uri url, {OnUploadProgress? onUploadProgress})
54+
MultipartRequest(String method, Uri url,
55+
{void Function(int uploaded, int total)? onUploadProgress})
5556
: super(method, url, onUploadProgress: onUploadProgress);
5657

5758
/// The total length of the request body, in bytes.

pkgs/http/lib/src/utils.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,3 @@ Stream<T> onDone<T>(Stream<T> stream, void Function() onDone) =>
7474
sink.close();
7575
onDone();
7676
}));
77-
78-
/// On upload progress callback.
79-
///
80-
/// See : "MultipartRequest"
81-
typedef OnUploadProgress = void Function(int uploaded, int total);

0 commit comments

Comments
 (0)