More `HttpClientResponse implements Stream<Uint8List>` fixes (#35149)
https://github.com/dart-lang/sdk/issues/36900
diff --git a/packages/flutter_tools/test/base/net_test.dart b/packages/flutter_tools/test/base/net_test.dart
index c38437a..46da5ff 100644
--- a/packages/flutter_tools/test/base/net_test.dart
+++ b/packages/flutter_tools/test/base/net_test.dart
@@ -233,7 +233,7 @@
}
}
-class MockHttpClientResponse extends Stream<List<int>> implements io.HttpClientResponse {
+class MockHttpClientResponse implements io.HttpClientResponse {
MockHttpClientResponse(this.statusCode);
@override
@@ -254,6 +254,11 @@
}
@override
+ Future<dynamic> forEach(void Function(Uint8List element) action) {
+ return Future<void>.error(const io.SocketException('test'));
+ }
+
+ @override
dynamic noSuchMethod(Invocation invocation) {
throw 'io.HttpClientResponse - $invocation';
}
diff --git a/packages/flutter_tools/test/commands/create_test.dart b/packages/flutter_tools/test/commands/create_test.dart
index 68c60c8..5ea6689 100644
--- a/packages/flutter_tools/test/commands/create_test.dart
+++ b/packages/flutter_tools/test/commands/create_test.dart
@@ -1286,7 +1286,7 @@
}
}
-class MockHttpClientResponse extends Stream<List<int>> implements HttpClientResponse {
+class MockHttpClientResponse implements HttpClientResponse {
MockHttpClientResponse(this.statusCode, {this.result});
@override
@@ -1314,6 +1314,12 @@
}
@override
+ Future<dynamic> forEach(void Function(Uint8List element) action) {
+ action(Uint8List.fromList(result.codeUnits));
+ return Future<void>.value();
+ }
+
+ @override
dynamic noSuchMethod(Invocation invocation) {
throw 'io.HttpClientResponse - $invocation';
}