Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialog doesn't close by tapping on "onConfirmBtnTap". #6

Closed
irfan0429 opened this issue Dec 11, 2020 · 6 comments
Closed

Dialog doesn't close by tapping on "onConfirmBtnTap". #6

irfan0429 opened this issue Dec 11, 2020 · 6 comments

Comments

@irfan0429
Copy link

Dialog doesn't close when we use to tap "onConfirmBtnTap".

CoolAlert.show(
              context: context,
              type: CoolAlertType.success,
              text: responseData['msg'],
              onConfirmBtnTap: ( ){ ... }
        }

And How to hide the "loading" dialog automatically?

CoolAlert.show(
                      context: context,
                      type: CoolAlertType.loading,
                    );
@irfan0429 irfan0429 changed the title Dialog doesn't close on pressing "onConfirmBtnTap". Dialog doesn't close by tapping on "onConfirmBtnTap". Dec 11, 2020
@emrade
Copy link
Owner

emrade commented Dec 11, 2020 via email

@irfan0429
Copy link
Author

irfan0429 commented Dec 23, 2020

Hello, If I use Navigator.pop(context); it will get me back from that screen, but if I want to stay on same page?

@emrade
Copy link
Owner

emrade commented May 1, 2021

No it won't close the page. If you have the dialog open and you trigger a Navigator.pop, the dialog closes and not the page.

@emrade emrade closed this as completed May 1, 2021
@emrade
Copy link
Owner

emrade commented May 1, 2021

Hi, if you want to close the dialog you'd have to handle that yourself. All you need to do is call Navigator.pop(context);

On Fri, 11 Dec 2020, 5:21 am Irfan Akram, @.***> wrote: Dialog doesn't close when we use to tap "onConfirmBtnTap". CoolAlert.show( context: context, type: CoolAlertType.success, text: responseData['msg'], onConfirmBtnTap: ( ){ ... } } And How to hide the "loading" dialog automatically? CoolAlert.show( context: context, type: CoolAlertType.loading, ); — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#6>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGAMVZUJND3U67SJZRB2IODSUGT5FANCNFSM4UWCIR5A .

@webmasterscity i dunno why you would give a thumbs down to my answer but it's common knowledge that to close a dialog, all you have to do is pop it.

You can refer to this article @irfan0429 @webmasterscity

https://stackoverflow.com/questions/50683524/how-to-dismiss-flutter-dialog

@ankushmishra2903-official

Hi, if you want to close the dialog you'd have to handle that yourself. All you need to do is call Navigator.pop(context);

On Fri, 11 Dec 2020, 5:21 am Irfan Akram, @.***> wrote: Dialog doesn't close when we use to tap "onConfirmBtnTap". CoolAlert.show( context: context, type: CoolAlertType.success, text: responseData['msg'], onConfirmBtnTap: ( ){ ... } } And How to hide the "loading" dialog automatically? CoolAlert.show( context: context, type: CoolAlertType.loading, ); — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#6>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGAMVZUJND3U67SJZRB2IODSUGT5FANCNFSM4UWCIR5A .

@webmasterscity i dunno why you would give a thumbs down to my answer but it's common knowledge that to close a dialog, all you have to do is pop it.

You can refer to this article @irfan0429 @webmasterscity

https://stackoverflow.com/questions/50683524/how-to-dismiss-flutter-dialog

yes but i am using cool_alert: ^1.1.0 and I am trying in onConfirmBtnTap as when you click on btn than it goes to another page but in cool_alert it will redirect to new page but not close the dialog and when i use Navigator.pop(context); on before redirect but same not close and when i use it after redirect and it redirect and came in same page

@Ruslanbek0809
Copy link

Instead of Navigator.pop(context);, try this Navigator.of(context, rootNavigator: true).pop(); This solves custom back button press issue

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

No branches or pull requests

4 participants