downloadFile method
Downloads content to a file.
Implementation
Future<io.File?> downloadFile({
required String url,
required String savePath,
required String filename,
}) async {
final filePath = join(savePath, filename);
try {
final response = await dio.download(url, filePath);
return response.statusCode == 200 ? io.File(filePath) : null;
} catch (e) {
return null;
}
}