Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit ce6cb0e

Browse files
committed
Prepare for upcoming change to HttpRequest and HttpClientResponse
An upcoming change to the Dart SDK will change `HttpRequest` and `HttpClientResponse` from implementing `Stream<List<int>>` to implementing `Stream<Uint8List>`. This forwards-compatible change prepares for that SDK breaking change by casting the Stream to `List<int>` before transforming it. dart-lang/sdk#36900
1 parent 73b5e89 commit ce6cb0e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tool/update_blns.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Future<Null> main() async {
1212
try {
1313
var request = await client.getUrl(Uri.parse(_blnsJsonRawUrl));
1414
var response = await request.close();
15-
json = (jsonDecode(await response.transform(utf8.decoder).join('')) as List)
15+
json = (jsonDecode(await response.cast<List<int>>().transform(utf8.decoder).join('')) as List)
1616
.cast<String>();
1717
} finally {
1818
client.close();

tool/update_emojis.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Future<Null> main() async {
1010
var client = HttpClient();
1111
var request = await client.getUrl(Uri.parse(_emojisJsonRawUrl));
1212
var response = await request.close();
13-
var json = jsonDecode(await response.transform(utf8.decoder).join(''))
13+
var json = jsonDecode(await response.cast<List<int>>().transform(utf8.decoder).join(''))
1414
.map((alias, info) => MapEntry(alias, info.cast<String, dynamic>()))
1515
.cast<String, Map<String, dynamic>>();
1616
var emojisContent = StringBuffer('''

0 commit comments

Comments
 (0)