QuickAlert icon indicating copy to clipboard operation
QuickAlert copied to clipboard

Function that handle click when using attributes : onConfirmBtnTap and onCancelBtnTap don't work and the alert window does not dispose or close

Open Cirecodeur opened this issue 1 year ago • 1 comments

I try to use QuickAlert.confirm on a drawer. When I use function that handle click when using attributes : onConfirmBtnTap and onCancelBtnTap, it's doesn't work and the alert window does not dispose or close I use QuickAlert.show( context: context, type: QuickAlertType.confirm, title: "Confirm action", text: 'Do you want to log out?', confirmBtnText: 'oui', cancelBtnText: 'Non', confirmBtnColor: Colors.green, onConfirmBtnTap: (){ print("Yes"); logout(); Navigator.pop(context);

              });

Expected behavior I want the function set to attribute onConfirmBtnTap to be executed and to dispose of the QuickAlert window.

Smartphone

  • Device: [pixel]
  • OS: [Android 11]

Cirecodeur avatar Jun 20 '24 21:06 Cirecodeur

I managed to overcome this issue by adding Navigator.of(context, rootNavigator: true).pop();

See below:

onConfirmBtnTap: () async { Navigator.of(context, rootNavigator: true).pop(); Navigator.pop(context); });

paul-codezest avatar Feb 14 '25 11:02 paul-codezest