[dart-dio] multi-part file should accept filename
Created by: ayushin
Right now multipart forms methods are generated with Uint8List
type fields and hard-coded filename as the field name:
Map<String, dynamic> formData = {};
if (image != null) {
formData[r'image'] = MultipartFile.fromBytes(image, filename: r'image');
}
bodyData = FormData.fromMap(formData);
Which is incorrect, unsuitable for certain backends.
I think it is more suitable to generate these fields as MultipartFile
and let the upstream handle the MultipartFile generation, just like dart
generator does.