Skip to content
This repository has been archived by the owner on Nov 24, 2020. It is now read-only.

Dynamically update not working well #76

Open
zhangli-jerry opened this issue Aug 6, 2020 · 1 comment
Open

Dynamically update not working well #76

zhangli-jerry opened this issue Aug 6, 2020 · 1 comment

Comments

@zhangli-jerry
Copy link

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]
@damianthingshung
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants