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

Commit 02e2d0b

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 02e2d0b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

tool/update_blns.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ 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
16+
.cast<List<int>>()
17+
.transform(utf8.decoder)
18+
.join('')) as List)
1619
.cast<String>();
1720
} finally {
1821
client.close();

tool/update_emojis.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ 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(
14+
await response.cast<List<int>>().transform(utf8.decoder).join(''))
1415
.map((alias, info) => MapEntry(alias, info.cast<String, dynamic>()))
1516
.cast<String, Map<String, dynamic>>();
1617
var emojisContent = StringBuffer('''

0 commit comments

Comments
 (0)