简体   繁体   中英

How to dismiss custom dialog

i'm using the cool_alert library to show custom alerts to my app. But i can't find any way to dismiss a custom alert.

I'm showing the alert with this code below:

CoolAlert.show(
    context: context,
    type: CoolAlertType.success,
    title: 'Profile updated',
    text: "Your profile informations has been updated successfully!",
    loopAnimation: false,
);

Use this

Navigator.pop(context);

You need to call showCancelBtn:true . Default it is false. Also, you can use onCancelBtnTap

await CoolAlert.show(
  .....
  cancelBtnText: "Cancel",
  showCancelBtn: true,
  onCancelBtnTap: () {
    Navigator.of(context).pop();
     }
);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM