download method
Forces a file download by setting the Content-Disposition header.
Implementation
Response download(String path, [String? filename]) {
final res = file(path);
if (res.statusCode != 200) return res;
final name = filename ?? path.split(Platform.pathSeparator).last;
return res.withHeaders({
'content-disposition': 'attachment; filename="$name"',
});
}