Closed Mereep closed 2 months ago
In multipart_media_uploader.dart there seems to be a missue with the stream handling API
multipart_media_uploader.dart
await bodyController.addStream( _uploadMedia.stream .transform(_base64Encoder) .transform(ascii.encoder), );
https://github.com/google/googleapis.dart/blob/f5dceee24ea1ed7ff5943fa9ccead4e8ebe4bfe5/discoveryapis_commons/lib/src/multipart_media_uploader.dart#L57C7-L61C11
with
https://github.com/google/googleapis.dart/blob/f5dceee24ea1ed7ff5943fa9ccead4e8ebe4bfe5/discoveryapis_commons/lib/src/multipart_media_uploader.dart#L18
will result in an annoying runtime type error like type 'Base64Encoder' is not a subtype of type 'StreamTransformer<Uint8List, String>' of 'streamTransformer'
type 'Base64Encoder' is not a subtype of type 'StreamTransformer<Uint8List, String>' of 'streamTransformer'
after a bit of Google I found an API change related to this problem: https://groups.google.com/g/flutter-dev/c/zKWTAMJTvos
For me, it could be fixed by replacing with
await bodyController.addStream( _base64Encoder.bind(_uploadMedia.stream) .transform(ascii.encoder), );
will investigate!
Yep. Need to handle when the stream controller is a Uint8List
Uint8List
In
multipart_media_uploader.dart
there seems to be a missue with the stream handling APIhttps://github.com/google/googleapis.dart/blob/f5dceee24ea1ed7ff5943fa9ccead4e8ebe4bfe5/discoveryapis_commons/lib/src/multipart_media_uploader.dart#L57C7-L61C11
with
https://github.com/google/googleapis.dart/blob/f5dceee24ea1ed7ff5943fa9ccead4e8ebe4bfe5/discoveryapis_commons/lib/src/multipart_media_uploader.dart#L18
will result in an annoying runtime type error like
type 'Base64Encoder' is not a subtype of type 'StreamTransformer<Uint8List, String>' of 'streamTransformer'
after a bit of Google I found an API change related to this problem: https://groups.google.com/g/flutter-dev/c/zKWTAMJTvos
For me, it could be fixed by replacing with