filesUpload method
Future<HttpData>
filesUpload(
{ - List<MultipartFile>? multipartFile,
- String? url,
- String? filePath,
- String key = 'file',
- String? fileName,
- String? method,
- FormData? formData,
- ProgressCallback? onSendProgress,
- ProgressCallback? onReceiveProgress,
- Function? onStart,
- Function? onError,
- Function? onFinish,
- bool publicMethod = false,
})
Implementation
Future<HttpData> filesUpload({
List<MultipartFile>? multipartFile,
String? url,
String? filePath,
String key = 'file',
String? fileName,
String? method,
FormData? formData,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
Function? onStart,
Function? onError,
Function? onFinish,
bool publicMethod = false
}) async{
return await request(
url: url,
method: method ?? Method.post,
publicMethod: publicMethod,
data: formData??FormData.fromMap({
key: multipartFile
}),
onSendProgress: (int sent, int total){
onSendProgress?.call(sent, total);
},
onReceiveProgress: (int sent, int total){
onReceiveProgress?.call(sent, total);
},
);
}