showDestructiveConfirmation static method
Future<bool>
showDestructiveConfirmation({
- required String title,
- String? message,
- required String destructiveTitle,
- VoidCallback? onDestroy,
Shows a destructive confirmation alert.
Implementation
static Future<bool> showDestructiveConfirmation({
required String title,
String? message,
required String destructiveTitle,
VoidCallback? onDestroy,
}) async {
final result = await show(
title: title,
message: message,
actions: [
CNAlertAction(title: 'Cancel', style: CNAlertActionStyle.cancel),
CNAlertAction(
title: destructiveTitle,
style: CNAlertActionStyle.destructive,
onPressed: onDestroy,
),
],
);
return result == 1; // Returns true if destructive action was tapped
}