-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uploading with FormData throws a TypeError: type 'List<int>' is not a subtype of type 'Uint8List' of 'value' #2236
Comments
I think is related to:
I suppose the problem is in
Calling |
@fromlabs Could you try updating the implementation to below solve the problem? Future<void>(() async {
for (final file in files) {
writeUtf8('--$boundary$_rn');
writeUtf8(_headerForFile(file));
await writeStreamToSink<Uint8List>(
file.value
.finalize()
.map((e) => e is Uint8List ? e : Uint8List.fromList(e)),
controller,
);
writeLine();
}
}).then((_) {
writeUtf8('--$boundary--$_rn');
}).whenComplete(() {
controller.close();
}); |
Yes I've already tried your solution and it works. Meanwhile I found a workaround on my code:
Thanks @AlexV525! |
@fromlabs Are you able to extract a minimal reproducible example? I'm wondering why the issue (if it exists) escapes from our tests. |
I think because |
Huge thanks for your inputs! |
Package
dio
Version
5.4.3+1
Operating-System
Android, iOS
Adapter
Default Dio
Output of
flutter doctor -v
Dart Version
No response
Steps to Reproduce
Expected Result
No error
Actual Result
The text was updated successfully, but these errors were encountered: