dismiss dialog when user press button inside it
brizaldi opened this issue · 6 comments
brizaldi commented
AndroidHensen commented
var yyDialog = YYDialog();
yyDialog?.dismiss();
dhalloop7 commented
I tried the same but not working.
AndroidHensen commented
- make sure your context is scaffold.
- you can clone my code,run my project,i have a example.
brizaldi commented
@dhalloop7 instead of using dismiss, try this:
Navigator.of(context, rootNavigator: true).pop();
dont forget to pass context from the your root widget
dhalloop7 commented
I tried all above solutions but still it's not dismiss the dialog. Even I am getting callback as well but it's not dismissing the dialog and If I try to dismiss dialog inside callback sometime it's close the current page
AndroidHensen commented
try v1.0.20 'useRootNavigator' property
