file.dart icon indicating copy to clipboard operation
file.dart copied to clipboard

The File interface should explicitly declare that it returns Uint8List

Open thosakwe opened this issue 6 years ago • 1 comments

After version 5.0.8, packages using package:file in conjunction with a StreamConsumer<List<int>> will break in recent versions, because you can no longer pipe Stream<Uint8List> to a StreamConsumer<List<int>>. (https://github.com/dart-lang/sdk/issues/37179)

I'm more than willing to send a PR for this, but I think the File interface should include overrides that indicate that calls to openRead, etc. return Uint8List.

It was pretty hard to track this down, but it turned out to be a pretty breaking change in my experience.

Again, willing to send in a PR.

thosakwe avatar Jun 06 '19 16:06 thosakwe