showDiscardChangesConfirmation static method

Future<bool?> showDiscardChangesConfirmation(
  1. BuildContext context
)

Shows a discard changes confirmation dialog

Returns true if user confirmed discarding, false if cancelled

Implementation

static Future<bool?> showDiscardChangesConfirmation(BuildContext context) {
  const title = 'Discard Changes?';
  const message =
      'You have unsaved changes. Are you sure you want to discard them?';
  return SavePointsDialog.show(
    context,
    title: title,
    message: message,
    icon: Icons.warning_amber_rounded,
    iconColor: Colors.orange,
    confirmText: 'Discard',
    cancelText: 'Keep Editing',
    showCancelButton: true,
  );
}