setDownload method

void setDownload({
  1. required String filename,
})

Set the appropriate headers to download the file

Implementation

void setDownload({required String filename}) {
  headers.add('Content-Disposition', 'attachment; filename=$filename');
}