handleDownload method
void
handleDownload()
Implementation
void handleDownload(){
downloadHandler ??= (DownloadModel downloadModel) {
var status = downloadModel.downloadStatus;
switch (status) {
case DownloaderStatus.downloading:
if (downloadModel.progress < _progress) {
return;
}
_progress = downloadModel.progress;
if (_progress <= 1.0001) {
_dialog!.update(_progress);
}
break;
case DownloaderStatus.paused:
break;
case DownloaderStatus.failed:
// showToast("download failed!");
showDownloadFailDialog();
break;
case DownloaderStatus.succeeded:
doInstall();
break;
default:
}
};
executeDownload(updateEntity!.downloadUrl,downloadHandler: downloadHandler);
}