downloadFile function
Implementation
void downloadFile(String url, String fileName) {
if (kIsWeb) {
final anchorElement = web.HTMLAnchorElement()
..href = url
..setAttribute('download', fileName)
..target = '_blank'
..download = fileName;
web.document.body?.appendChild(anchorElement);
anchorElement
..click()
..remove();
}
}