belovance / QuickAlert

An instantly ready, full-featured alerts for development on any platform with flutter. Enabling you to complete projects and deploy quickly. With QuickAlert, you can display animated alert dialogs such as success, error, warning, confirm, loading or even a custom dialog.
https://pub.dev/packages/quickalert
MIT License
46 stars 42 forks source link

Close Dialog programatically #13

Closed bennito254 closed 1 year ago

bennito254 commented 1 year ago

Hello, first of all. Thank you for this amazing package. It has helped me provide an elegant and beautiful alerts to my app.

I have faced a situation where I need to close the dialog dynamically, after certain action. For example, when fetching data from an API is complete, I would want to close the "loading" dialog. I have seen the 'autoCloseDuration' option but there's really no way of knowing how much time such an action would take.

Kindly add the feature to close the dialog after an action. For example:

var alert = QuickAlert(options);
if(condition) {
alert.show();
} else {
if(alert.isOpen){
alert.close();
}
}
kururu-abdo commented 1 year ago

same problem i want to close alert and start another

bennito254 commented 1 year ago

I found out that using Navigator.of(context, rootNavigator: true).pop(); closes the dialog. But I believe it would be better if the package had a close method

ItsAkashS22 commented 1 year ago

Hello @bennito254 & @kururu-abdo 👋 Thank you for using the package and your love towards the package. This enhancement has been already added to the current sprint of feature upgradations. Will be out with an update soon.

I used to handle these type of cases like this:

QuicklAlert.show(options); // Loading Alert Launched
....
// Do other asynchronous actions
.....
Navigator.pop(context); // Pop out the Loading Alert

We can do same thing multiple times before we return a value (if working in a function) or change the state.

Till the new update rolls out, help yourself doing the same or any other workarounds. Happy Coding ✨

bennito254 commented 1 year ago

Thank you and Happy Coding

oxcakmak commented 1 year ago

I found out that using Navigator.of(context, rootNavigator: true).pop(); closes the dialog. But I believe it would be better if the package had a close method

Many thanks, I can also close the message box with this code.

image_2023-04-16_061325935

lucagonzalez commented 1 year ago

Hello @bennito254 & @kururu-abdo 👋 Thank you for using the package and your love towards the package. This enhancement has been already added to the current sprint of feature upgradations. Will be out with an update soon.

I used to handle these type of cases like this:

QuicklAlert.show(options); // Loading Alert Launched
....
// Do other asynchronous actions
.....
Navigator.pop(context); // Pop out the Loading Alert

We can do same thing multiple times before we return a value (if working in a function) or change the state.

Till the new update rolls out, help yourself doing the same or any other workarounds. Happy Coding ✨

Hello!

Is this update abandoned?