Skip to content

Commit

Permalink
Prepare for Uint8List SDK breaking change
Browse files Browse the repository at this point in the history
A recent change to the Dart SDK updated `HttpClientResponse`
to implement `Stream<Uint8List>` rather than implementing
`Stream<List<int>>`.

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.

dart-lang/sdk#36900
  • Loading branch information
wrenchMither authored and tvolkert committed Nov 3, 2021
1 parent e27dfce commit 98de997
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion example/lib/pay_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class _PayPageState extends State<PayPage> {
};
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<String, dynamic> result = json.decode(data);
print(result['appid']);
print(result["timestamp"]);
Expand Down

0 comments on commit 98de997

Please sign in to comment.