Skip to content

Commit 2faebf7

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 2faebf7

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

tool/grind.dart

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import 'dart:async';
55
import 'dart:convert';
66
import 'dart:io';
7+
import 'dart:typed_data';
78

89
import 'package:args/args.dart';
910
import 'package:args/command_runner.dart';
@@ -133,6 +134,7 @@ Future<File> genPluginXml(BuildSpec spec, String destDir, String path) async {
133134
dest.writeln();
134135
await new File(p.join(rootPath, 'resources', templatePath))
135136
.openRead()
137+
.cast<List<int>>()
136138
.transform(utf8.decoder)
137139
.transform(new LineSplitter())
138140
.forEach((l) => dest.writeln(substituteTemplateVariables(l, spec)));

0 commit comments

Comments
 (0)