From 98de997ad6c1436cce7f0b7098e9cbbc4bb50cc8 Mon Sep 17 00:00:00 2001 From: wrenchMither Date: Wed, 3 Nov 2021 21:09:22 +0800 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 --- example/lib/pay_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/lib/pay_page.dart b/example/lib/pay_page.dart index c00ec87..91480d8 100644 --- a/example/lib/pay_page.dart +++ b/example/lib/pay_page.dart @@ -42,7 +42,7 @@ class _PayPageState extends State { }; var request = await h.getUrl(Uri.parse(_url)); var response = await request.close(); - var data = await response.transform(Utf8Decoder()).join(); + var data = await Utf8Decoder().bind(response).join(); Map result = json.decode(data); print(result['appid']); print(result["timestamp"]);