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