Reputation: 103
I get response from HttpClientResponse
After that trying to perform listen like:
//... your code
response.transform(utf8.decoder).listen( (data) {
//... your code
})
//... your code
The argument type 'Utf8Decoder' can't be assigned to the parameter type 'StreamTransformer<Uint8List, dynamic>'
4cd12fc8b
Upvotes: 1
Views: 808
Reputation: 185
This implementation is changed after fixing a bug in Stream handling.
Following is the changed request raised in Flutter community - https://github.com/dart-lang/sdk/issues/36900
You can fix this issue with following changes
request.close().then((response){
response.cast<List<int>>().transform(utf8.decoder).listen((content) {
return content;
});
});
For reference : https://github.com/dart-lang/co19/pull/384
Upvotes: 4