downloadFile method
Implementation
Future<io.File> downloadFile(
String url, {
required String savePath,
required String filename,
}) async {
final directory = io.Directory(savePath);
final filePath = path.join(directory.path, filename);
await dio.download(url, filePath).then(
(response) => response.data,
);
return io.File(filePath);
}