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

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

@jjosenaldo

Description

@jjosenaldo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions