show static method

Future<bool?> show(
  1. BuildContext context, {
  2. required String title,
  3. required String message,
  4. String confirmLabel = 'Confirm',
  5. String cancelLabel = 'Cancel',
  6. bool destructive = false,
  7. bool barrierDismissible = true,
})

Shows a ConfirmDialogWidget and resolves to the user's choice. Returns true if confirmed, false if cancelled, null if the dialog was dismissed by tapping the barrier or pressing back.

Implementation

static Future<bool?> show(
  BuildContext context, {
  required String title,
  required String message,
  String confirmLabel = 'Confirm',
  String cancelLabel = 'Cancel',
  bool destructive = false,
  bool barrierDismissible = true,
}) {
  return showDialog<bool>(
    context: context,
    barrierDismissible: barrierDismissible,
    builder: (_) => ConfirmDialogWidget(
      title: title,
      message: message,
      confirmLabel: confirmLabel,
      cancelLabel: cancelLabel,
      destructive: destructive,
    ),
  );
}