upload method
Future<Response>
upload(
- String path,
- String filePath, {
- String? filename,
- ProgressCallback? onSendProgress,
- Options? options,
- CancelToken? cancelToken,
})
Implementation
Future<Response> upload(
String path,
String filePath, {
String? filename,
ProgressCallback? onSendProgress,
Options? options,
CancelToken? cancelToken,
}) async {
FormData formData = FormData.fromMap({
"file": await MultipartFile.fromFile(filePath, filename: filename),
});
return HttpUtils().request(path,
showLoading: false,
method: DioMethod.post,
data: formData,
options: options,
onSendProgress: onSendProgress,
cancelToken: cancelToken);
}