downloadContent function
Implementation
Future<Uint8List> downloadContent(
String url, {
Duration expiration = const Duration(days: 365),
String? filename,
String? dirPath,
Function? onDownloadBegin,
Function? onDownloadEnd,
Function? onDownloadProgress,
}) async {
final path = await download(
url,
expiration: expiration,
filename: filename,
dirPath: dirPath,
onDownloadBegin: onDownloadBegin,
onDownloadEnd: onDownloadEnd,
onDownloadProgress: onDownloadProgress,
);
/// Read the file
final file = File(path);
/// Return the content of the file.
return await file.readAsBytes();
}