rflutter_alert
rflutter_alert copied to clipboard
onDismiss/onClose event
Hi, how can i run some code when the user clicks on the black background (the alert gets dismissed) and when the user clicks the close button ?
I know this is a rather old question, but you can
bool? discard = await Alert(
context: context,
content: const Text('Unsaved changes exist, '
'are you sure you want to discard these changes?'),
buttons: [
DialogButton(
child: const Text('Cancel'),
onPressed: () => Navigator.pop(context, false),
),
DialogButton(
child: const Text('Discard'),
onPressed: () => Navigator.pop(context, true),
),
],
).show();
null is returned in the case of pressing the x or tapping outside the dialog
I'm closing this issue because no more recent activity.