I am a flutter beginner and wish to work on a podcast app for a church. I am trying to implement a download functionality with background_downloader package. I have implemented the download alright but in my download screen, I have difficulties getting realtime progress updates
.
main.dart file
await FileDownloader().trackTasks();
await FileDownloader().resumeFromBackground();
this is the download function in my homescreen
Future<void> downloadSermon(Sermon sermon) {
final enqueued = await FileDownloader().enqueue(
DownloadTask(
taskId: sermon.url,
url: sermon.url,
filename: cleanFileName(sermon.name),
allowPause: true,
directory: 'sermons',
updates: Updates.statusAndProgress,
displayName: sermon.name,
),
);
}
I wish to get updates in my downloads screen. But I am not able to make sense of the documentation. How can I implement the callback function and get the realtime updates in the download screen?