Skip to content

Commit 401a573

Browse files
committed
Fix per SDK Stream<Uint8List> breaking changes
This updates call sites with forward-compatible fixes for a recent Dart SDK change that changed the following APIs to be `Stream<Uint8List>` rather than `Stream<List<int>>`: * HttpClientResponse * File.openRead() dart-lang/sdk#36900
1 parent 83d864c commit 401a573

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

tool/grind.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ colors() async {
4646
// Get color file from flutter.
4747
HttpClientRequest request = await new HttpClient().getUrl(Uri.parse(kUrl));
4848
HttpClientResponse response = await request.close();
49-
List<String> data = await response.transform(utf8.decoder).toList();
49+
List<String> data = await utf8.decoder.bind(response).toList();
5050

5151
// Remove an import and define the Color class.
5252
String str = data.join('');

tool/icons/update_icons.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void main() async {
3939
Future<String> downloadUrl(String url) async {
4040
HttpClientRequest request = await new HttpClient().getUrl(Uri.parse(url));
4141
HttpClientResponse response = await request.close();
42-
List<String> data = await response.transform(utf8.decoder).toList();
42+
List<String> data = await utf8.decoder.bind(response).toList();
4343
return data.join('');
4444
}
4545

tool/plugin/lib/plugin.dart

+2-3
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,8 @@ Future<File> genPluginXml(BuildSpec spec, String destDir, String path) async {
131131
dest.writeln(
132132
"<!-- Do not edit; instead, modify ${p.basename(templatePath)}, and run './bin/plugin generate'. -->");
133133
dest.writeln();
134-
await new File(p.join(rootPath, 'resources', templatePath))
135-
.openRead()
136-
.transform(utf8.decoder)
134+
await utf8.decoder
135+
.bind(new File(p.join(rootPath, 'resources', templatePath)).openRead())
137136
.transform(new LineSplitter())
138137
.forEach((l) => dest.writeln(substituteTemplateVariables(l, spec)));
139138
await dest.close();

0 commit comments

Comments
 (0)