Skip to content

Commit cdde7b0

Browse files
authored
Drop an obsolete hack for async as argument name (#319)
This was working around a bug where in an `async` method you couldn't use `async` as a named argument in a call. Bump min SDK to `2.4.0`, it fixes the analyzer bug.
1 parent d5344a3 commit cdde7b0

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ language: dart
22

33
dart:
44
- dev
5-
- 2.2.0
5+
- 2.4.0
66

77
dart_task:
88
- test: --platform vm

lib/src/browser_client.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ class BrowserClient extends BaseClient {
4545
var bytes = await request.finalize().toBytes();
4646
var xhr = HttpRequest();
4747
_xhrs.add(xhr);
48-
_openHttpRequest(xhr, request.method, request.url.toString(), asynch: true);
4948
xhr
49+
..open(request.method, '${request.url}', async: true)
5050
..responseType = 'blob'
5151
..withCredentials = withCredentials;
5252
request.headers.forEach(xhr.setRequestHeader);
@@ -93,12 +93,6 @@ class BrowserClient extends BaseClient {
9393
}
9494
}
9595

96-
// TODO(nweiz): Remove this when sdk#24637 is fixed.
97-
void _openHttpRequest(HttpRequest request, String method, String url,
98-
{bool asynch, String user, String password}) {
99-
request.open(method, url, async: asynch, user: user, password: password);
100-
}
101-
10296
/// Closes the client.
10397
///
10498
/// This terminates all active requests.

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ homepage: https://github.com/dart-lang/http
55
description: A composable, multi-platform, Future-based API for HTTP requests.
66

77
environment:
8-
sdk: ">=2.2.0 <3.0.0"
8+
sdk: ">=2.4.0 <3.0.0"
99

1010
dependencies:
1111
async: ">=1.10.0 <3.0.0"

0 commit comments

Comments
 (0)