upload method
Implementation
@override
Future<FileInfo?> upload(
String id,
file, {
Function(int sent, int total)? onSent,
Function(dynamic)? onFail,
}) async {
var res = await helper.upload(
'/files/$id',
file,
method: 'put',
onSent: onSent,
handleError: onFail,
);
if (res != false) {
return FileInfo.fromJson(res['data']);
}
return null;
}