downloadFile method
Implementation
@override
Future<String?> downloadFile(String url, Map<String, dynamic> body, {String fallbackFilename = "file"}) async {
http.Response response = await http.post(
Uri.parse(url),
body: body,
);
FileInfo fileInfo = parseFileInfo(response.headers["content-disposition"]) ?? FileInfo(fallbackFilename, "");
var blob = html.Blob([response.bodyBytes], response.headers["content-type"], "native");
html.AnchorElement(href: html.Url.createObjectUrl(blob).toString())
..setAttribute("download", "${fileInfo.fileName}${fileInfo.fileExtension}")
..click();
return null;
}