From 3ad758ee5f3b99c93b41044bc4ac525c11ac9ac5 Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Wed, 3 Jul 2019 22:39:42 -0700 Subject: [PATCH] Prepare for Uint8List SDK breaking change A recent change to the Dart SDK updated `HttpClientResponse` to implement `Stream` rather than implementing `Stream>`. This forwards-compatible chnage updates calls to `Stream.transform(StreamTransformer)` to instead call the functionally equivalent `StreamTransformer.bind(Stream)` API, which puts the stream in a covariant position and thus causes the SDK change to be non-breaking. https://github.com/dart-lang/sdk/issues/36900 --- lib/dartio_http_client.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dartio_http_client.dart b/lib/dartio_http_client.dart index 93e8d24..5275860 100644 --- a/lib/dartio_http_client.dart +++ b/lib/dartio_http_client.dart @@ -86,9 +86,9 @@ class DartIOHttpClient extends SignalRHttpClient { final isJsonContent = contentTypeHeader.indexOf("application/json") != -1; if (isJsonContent) { - content = await httpResp.transform(utf8.decoder).join(); + content = await utf8.decoder.bind(httpResp).join(); } else { - content = await httpResp.transform(utf8.decoder).join(); + content = await utf8.decoder.bind(httpResp).join(); // When using SSE and the uri has an 'id' query parameter the response is not evaluated, otherwise it is an error. if (isStringEmpty(uri.queryParameters['id'])) { throw ArgumentError(