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

Dialog not being hid after dispose() being called #81

Open
jjosenaldo opened this issue Sep 15, 2020 · 0 comments
Open

Dialog not being hid after dispose() being called #81

jjosenaldo opened this issue Sep 15, 2020 · 0 comments

Comments

@jjosenaldo
Copy link

My code is roughly the following:

await progressDialog.show(); // (1)
await callExternalApi(); // (2)
await progressDialog.hide(); // (3) 

Between (2) and (3), the ProgressDialog dismissed by back button log was shown, but the callExternalApi does nothing but calling an external API (and, well, I did not press the back button). Besides, the dialog was not dismissed. It also involves a Provider, but I don't think that's relevant. I looked up the code of this lib, and noticed that the log is shown in the dispose method of the _BodyState class, but that method does not call Navigator.pop. As a temporary workaround, I'm doing the following:

await progressDialog.show(); 
await callExternalApi(); 
if(progressDialog.isShowing()) {
    await progressDialog.hide();
} else{
    Navigator.pop(dialogContext);
}

but it is far from ideal. I have no idea why the dispose method of _BodyState was called.

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

1 participant