uploadFile<T> method
上传文件
Implementation
Future<void> uploadFile<T>(
String url, {
String? baseUrl,
required FormData data,
Success? success,
Empty? empty,
Error? error,
CancelToken? cancelToken, //可自定义一个取消令牌,也可从回调中获取系统默认取消令牌
OnValueCallBack<CancelToken>? cancelTokenCallBack, //回调,返回一个取消令牌
ProgressCallback? onSendProgress, // 上传数据进度
}) async {
// MultipartFile.fromFile("filePath",filename: "");
return await _request(Method.post, url,
data: data,
baseUrl: baseUrl,
cancelToken: cancelToken,
cancelTokenCallBack: cancelTokenCallBack,
onSendProgress: onSendProgress,
success: success,
empty: empty,
error: error);
}