在Flutter中使用firebase_storage下载文件时,如何使用进度条设置侦听器
void downloadLectures(int lecture) async {
createDirectory(lecture.toString());
print("[HandleFiles] downloadLectures($lecture)");
int audiosCount = this.lessonsCount[lecture - 3][lecture];
Directory appDocDirectory = await getApplicationDocumentsDirectory();
for(int i = 1; i <= audiosCount; i++) {
File file = File('${appDocDirectory.path}/downloads/$lecture/$i.wav');
StorageReference ref = FirebaseStorage.instance.ref().child("audios/$lecture/$i.wav");
print("Doenloading $i.wav");
StorageFileDownloadTask downloadTask = ref.writeToFile(file);
int byteNumber = (await downloadTask.future).totalByteCount;
print("byteNumber: $byteNumber");
}
}