filesUpload method

Future<HttpData> filesUpload({
  1. List<MultipartFile>? multipartFile,
  2. String? url,
  3. String? filePath,
  4. String key = 'file',
  5. String? fileName,
  6. String? method,
  7. FormData? formData,
  8. ProgressCallback? onSendProgress,
  9. ProgressCallback? onReceiveProgress,
  10. Function? onStart,
  11. Function? onError,
  12. Function? onFinish,
  13. 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);
    },
  );
}