fayaz07 / progress_dialog

A light weight library to easily manage a progress dialog with simple steps whenever you need to do it. You can easily show and hide it.

Home Page:https://fayaz07.github.io/progress_dialog/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dynamically update not working well

zhangli-jerry opened this issue · comments

Describe the bug
ProgressDialogType.Download , show/hide works well.
When use pr.update, the process is stopped and dialog is showing.

To Reproduce

await dio.download(
      downloadUrl,
      savePath,
      onReceiveProgress: (rcv, total) {
        print('received: ${rcv.toStringAsFixed(0)} out of total: ${total.toStringAsFixed(0)}');

        setState(() {
          progress = ((rcv / total) * 100 * 10).roundToDouble() / 10;
          print('progress:$progress');
        });

        pr.update(progress: progress, message: "Downloading file...");   // <-- this code not working

        if (progress == 100.0) {
          setState(() {
            isDownloaded = true;
          });
        } else if (progress < 100.0) {}
      },
      deleteOnError: true,
    );

Expected behavior
progress text will be updated

Smartphone:

  • Device: [iPhoneX Max]
  • OS: [iOS13.6]

I am having the same problem. Have you found the solution?