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

Allow to await for the dialog show #38

Closed
neokree opened this issue Dec 19, 2019 · 5 comments
Closed

Allow to await for the dialog show #38

neokree opened this issue Dec 19, 2019 · 5 comments

Comments

@neokree
Copy link

neokree commented Dec 19, 2019

Problem statement
I use the progress dialog to keep the user informed of a blocking operation.
So the progress dialog must be showed and hidden after an operation, but if the operation is async but terminates very quickly, the dialog is not hidden, because the showDialog method (used internally in the .show()) does not have finished showing the dialog.

Describe the solution you'd like
I would like to be allow to await the .show() method, like this

ProgressDialog dialog = ...; 
await dialog.show();

// do some work ...

await dialog.hide();
@openwrd
Copy link

openwrd commented Dec 20, 2019

good idea, but call funciton require async.

@neokree
Copy link
Author

neokree commented Dec 26, 2019

good idea, but call funciton require async.

Yeah sure, it is the main point of doing it.
Obviously you could also use the .then() method and chaining the Futures, but I think it is more readable this way.

@tmibvishal
Copy link

Until this issue is resolved, you can use
await Future.delayed(Duration(seconds: 1));
for allowing the dialog to pop up

@BjoernPetersen
Copy link

Could we get a new release with the fixed version?

By the way (for the impatient), a workaround until then:

pubspec.yaml

dependencies:
  progress_dialog:
    git: https://github.com/fayaz07/progress_dialog.git

@fayaz07
Copy link
Owner

fayaz07 commented Feb 12, 2020

Update v1.2.1 is live, please checkout

@fayaz07 fayaz07 closed this as completed Feb 12, 2020
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

5 participants