trevorwang / retrofit.dart

retrofit.dart is an dio client generator using source_gen and inspired by Chopper and Retrofit.
https://mings.in/retrofit.dart/
MIT License
1.08k stars 248 forks source link

Support single MultipartFile, not only List<MultipartFile> #464

Open brun0xon opened 2 years ago

brun0xon commented 2 years ago

Cannot pass single MultipartFile as Part() param. Getting generator error Exception: toJson() method have to add to MultipartFile. I can't use File type, because generator uses Platform.pathSeparator which throws in web, and can't use List<int>, because it may be a different file extension type.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

StarProxima commented 8 months ago

@trevorwang Is there no progress on this problem?

Dio supports single file sending - https://pub.dev/packages/dio#sending-formdata