showDestructiveConfirmation static method

Future<bool> showDestructiveConfirmation({
  1. required String title,
  2. String? message,
  3. required String destructiveTitle,
  4. VoidCallback? onDestroy,
})

Shows a destructive confirmation alert.

Implementation

static Future<bool> showDestructiveConfirmation({
  required String title,
  String? message,
  required String destructiveTitle,
  VoidCallback? onDestroy,
}) async {
  final context = NavigationService.navigatorKey.currentContext;
  if (context == null) {
    throw StateError('No navigator context available. Make sure NavigationService.navigatorKey is set in your MaterialApp.');
  }

  return await BaseAlert.showDestructiveConfirmation(
    context: context,
    title: title,
    message: message,
    destructiveTitle: destructiveTitle,
    onDestroy: onDestroy,
  );
}